diff --git a/BNFC.cabal b/BNFC.cabal
--- a/BNFC.cabal
+++ b/BNFC.cabal
@@ -1,9 +1,9 @@
 Name: BNFC
-Version: 2.8.1
+Version: 2.8.2
 cabal-version: >= 1.8
 build-type: Simple
 category: Development
-Copyright: (c) Krasimir Angelov, Jean-Philippe Bernardy, Bjorn Bringert, Johan Broberg, Paul Callaghan, Markus Forsberg, Ola Frid, Peter Gammie, Patrik Jansson, Kristofer Johannisson, Antti-Juhani Kaijanaho, Ulf Norell, Michael Pellauer and Aarne Ranta 2002 - 2012. Free software under GNU General Public License (GPL).
+Copyright: (c) Andreas Abel, Kyle Butt, Jonas Almström Duregård, Krasimir Angelov, Jean-Philippe Bernardy, Bjorn Bringert, Johan Broberg, Paul Callaghan, Grégoire Détrez, Markus Forsberg, Ola Frid, Peter Gammie, Thomas Hallgren, Pascal Hof, Patrik Jansson, Kristofer Johannisson, Antti-Juhani Kaijanaho, Andreas Lööw, Kent Mein, Ulf Norell, Gabrielle Paganelli, Michael Pellauer and Aarne Ranta 2002 - 2018. Free software under GNU General Public License (GPL).
 License: GPL-2
 License-File: LICENSE
 Maintainer: bnfc-dev@googlegroups.com
@@ -13,16 +13,23 @@
 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,
-  but starting from Version 2.0, it can also be used for generating Java, C++, and C.
+  but can also be used for generating Java, C, C++, C#, Ocaml and XML.
   .
   Given a Labelled BNF grammar the tool produces:
-  an abstract syntax as a Haskell/C++/C module or Java directory,
+  an abstract syntax as a Haskell, C, C++, C#, Ocaml module or Java directory,
   a case skeleton for the abstract syntax in the same language,
   an Alex, JLex, or Flex lexer generator file,
-  a Happy, CUP, or Bison parser generator file,
-  a pretty-printer as a Haskell/Java/C++/C module,
+  a Happy, CUP, Bison, or Antlr parser generator file,
+  a pretty-printer as a Haskell, Java, C, C++, C#, or Ocaml module,
+  an XML representation,
   a Latex file containing a readable specification of the language.
-Extra-source-files: src/BNF.cf TODO changelog
+tested-with: GHC == 7.6.3
+           , GHC == 7.8.4
+           , GHC == 7.10.3
+           , GHC == 8.0.2
+           , GHC == 8.2.2
+           , GHC == 8.4.4
+Extra-source-files: src/BNF.cf TODO changelog Makefile
 
 Source-repository head
   type: git
@@ -31,7 +38,7 @@
 
 Library
   hs-source-dirs: runtime, src
-  Build-Depends: base>=4.4 && <5, array
+  Build-Depends: base>=4.6 && <5, array
   exposed-modules:
    Algebra.RingUtils
    Data.Pair
@@ -42,7 +49,7 @@
 
 Executable bnfc
   Build-Depends:
-    base>=4.4 && <5,
+    base>=4.6 && <5,
     mtl,
     directory,
     array,
@@ -53,125 +60,137 @@
     deepseq
   build-tools:         alex, happy
   Main-is: Main.hs
-  HS-source-dirs: src/
+  HS-source-dirs: compat src
   ghc-options:     -W
-  extensions: OverloadedStrings RecordWildCards FlexibleContexts
+  extensions:
+    FlexibleContexts
+    LambdaCase
+    OverloadedStrings
+    RecordWildCards
+    ScopedTypeVariables
+    TupleSections
   Other-modules:
     -- generated by cabal
-    Paths_BNFC,
+    Paths_BNFC
     -- Generated by bnfc
-    LexBNF,
-    ParBNF,
-    AbsBNF,
-    PrintBNF,
-    ErrM,
+    LexBNF
+    ParBNF
+    AbsBNF
+    PrintBNF
+    ErrM
     -- BNFC core
-    BNFC.Utils,
-    BNFC.CF,
-    BNFC.ToCNFCore,
-    BNFC.MultiView,
-    BNFC.TypeChecker,
-    BNFC.GetCF,
-    BNFC.Lexing,
+    Prelude'
+    BNFC.Utils
+    BNFC.CF
+    BNFC.ToCNFCore
+    BNFC.MultiView
+    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.WarningM,
-    Data.Pair,
-    BNFC.Backend.Utils,
-    BNFC.PrettyPrint,
+    BNFC.Backend.Common
+    BNFC.Backend.Common.Makefile
+    BNFC.Backend.Common.NamedVariables
+    BNFC.Backend.Common.OOAbstract
+    BNFC.Backend.Common.StrUtils
+    BNFC.Options
+    BNFC.WarningM
+    Data.Pair
+    BNFC.PrettyPrint
 
     -- Documentation backends
-    BNFC.Backend.Latex,
-    BNFC.Backend.Txt2Tag,
+    BNFC.Backend.Latex
+    BNFC.Backend.Txt2Tag
 
     -- Haskell backend
-    BNFC.Backend.Haskell,
-    BNFC.Backend.Haskell.ToCNF,
-    BNFC.Backend.Haskell.RegToAlex,
-    BNFC.Backend.Haskell.CFtoTemplate,
-    BNFC.Backend.Haskell.CFtoAlex3,
-    BNFC.Backend.Haskell.CFtoAlex2,
-    BNFC.Backend.Haskell.CFtoAlex,
-    BNFC.Backend.Haskell.CFtoHappy,
-    BNFC.Backend.Haskell.CFtoPrinter,
-    BNFC.Backend.Haskell.CFtoAbstract,
-    BNFC.Backend.Haskell.CFtoLayout,
-    BNFC.Backend.Haskell.MkErrM,
-    BNFC.Backend.Haskell.MkSharedString,
-    BNFC.Backend.Haskell.HsOpts,
-    BNFC.Backend.Haskell.Utils,
+    BNFC.Backend.Haskell
+    BNFC.Backend.Haskell.ToCNF
+    BNFC.Backend.Haskell.RegToAlex
+    BNFC.Backend.Haskell.CFtoTemplate
+    BNFC.Backend.Haskell.CFtoAlex3
+    BNFC.Backend.Haskell.CFtoAlex2
+    BNFC.Backend.Haskell.CFtoAlex
+    BNFC.Backend.Haskell.CFtoHappy
+    BNFC.Backend.Haskell.CFtoPrinter
+    BNFC.Backend.Haskell.CFtoAbstract
+    BNFC.Backend.Haskell.CFtoLayout
+    BNFC.Backend.Haskell.MkErrM
+    BNFC.Backend.Haskell.MkSharedString
+    BNFC.Backend.Haskell.HsOpts
+    BNFC.Backend.Haskell.Utils
     -- Profile
-    BNFC.Backend.HaskellProfile,
-    BNFC.Backend.HaskellProfile.CFtoHappyProfile,
+    BNFC.Backend.HaskellProfile
+    BNFC.Backend.HaskellProfile.CFtoHappyProfile
     -- Haskell GADT
-    BNFC.Backend.HaskellGADT,
-    BNFC.Backend.HaskellGADT.HaskellGADTCommon,
-    BNFC.Backend.HaskellGADT.CFtoTemplateGADT,
-    BNFC.Backend.HaskellGADT.CFtoAbstractGADT,
+    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,
+    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.CFtoCPrinter,
-    BNFC.Backend.C.CFtoCSkel,
-    BNFC.Backend.C.CFtoBisonC,
-    BNFC.Backend.C.CFtoFlexC,
-    BNFC.Backend.C.CFtoCAbs,
-    BNFC.Backend.CPP.NoSTL.CFtoCVisitSkel,
+    BNFC.Backend.C
+    BNFC.Backend.C.CFtoCPrinter
+    BNFC.Backend.C.CFtoCSkel
+    BNFC.Backend.C.CFtoBisonC
+    BNFC.Backend.C.CFtoFlexC
+    BNFC.Backend.C.CFtoCAbs
+    BNFC.Backend.CPP.NoSTL.CFtoCVisitSkel
 
     -- C++ backend
-    BNFC.Backend.CPP.NoSTL,
-    BNFC.Backend.CPP.PrettyPrinter,
-    BNFC.Backend.CPP.NoSTL.RegToFlex,
-    BNFC.Backend.CPP.NoSTL.CFtoFlex,
-    BNFC.Backend.CPP.NoSTL.CFtoBison,
-    BNFC.Backend.CPP.NoSTL.CFtoCPPAbs,
+    BNFC.Backend.CPP.PrettyPrinter
+    BNFC.Backend.CPP.Makefile
+    BNFC.Backend.CPP.Naming
+    BNFC.Backend.CPP.NoSTL
+    BNFC.Backend.CPP.NoSTL.RegToFlex
+    BNFC.Backend.CPP.NoSTL.CFtoFlex
+    BNFC.Backend.CPP.NoSTL.CFtoBison
+    BNFC.Backend.CPP.NoSTL.CFtoCPPAbs
 
     -- C++ STL backend
-    BNFC.Backend.CPP.STL,
-    BNFC.Backend.CPP.STL.CFtoBisonSTL,
-    BNFC.Backend.CPP.STL.CFtoSTLAbs,
-    BNFC.Backend.CPP.STL.STLUtils,
-    BNFC.Backend.CPP.STL.CFtoCVisitSkelSTL,
+    BNFC.Backend.CPP.STL
+    BNFC.Backend.CPP.STL.CFtoBisonSTL
+    BNFC.Backend.CPP.STL.CFtoSTLAbs
+    BNFC.Backend.CPP.STL.STLUtils
+    BNFC.Backend.CPP.STL.CFtoCVisitSkelSTL
 
     -- C# backend
-    BNFC.Backend.CSharp,
-    BNFC.Backend.CSharp.RegToGPLEX,
-    BNFC.Backend.CSharp.CFtoGPLEX,
-    BNFC.Backend.CSharp.CSharpUtils,
-    BNFC.Backend.CSharp.CFtoCSharpPrinter,
-    BNFC.Backend.CSharp.CAbstoCSharpAbs,
-    BNFC.Backend.CSharp.CAbstoCSharpAbstractVisitSkeleton,
-    BNFC.Backend.CSharp.CAbstoCSharpVisitSkeleton,
-    BNFC.Backend.CSharp.CFtoGPPG,
+    BNFC.Backend.CSharp
+    BNFC.Backend.CSharp.RegToGPLEX
+    BNFC.Backend.CSharp.CFtoGPLEX
+    BNFC.Backend.CSharp.CSharpUtils
+    BNFC.Backend.CSharp.CFtoCSharpPrinter
+    BNFC.Backend.CSharp.CAbstoCSharpAbs
+    BNFC.Backend.CSharp.CAbstoCSharpAbstractVisitSkeleton
+    BNFC.Backend.CSharp.CAbstoCSharpVisitSkeleton
+    BNFC.Backend.CSharp.CFtoGPPG
 
     -- Java backend
     BNFC.Backend.Java
-    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.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
@@ -186,18 +205,165 @@
                  hspec, QuickCheck >= 2.5, HUnit,
                  temporary, containers, deepseq
   Main-is: unit-tests.hs
-  HS-source-dirs: src test
-  extensions: OverloadedStrings RecordWildCards FlexibleContexts
+  HS-source-dirs: compat src test
+  extensions:
+    FlexibleContexts
+    LambdaCase
+    OverloadedStrings
+    RecordWildCards
+    ScopedTypeVariables
+    TupleSections
   Other-modules:
-   BNFC.Backend.Common.MakefileSpec
-   BNFC.Backend.Haskell.CFtoHappySpec
-   BNFC.Backend.HaskellGADTSpec
-   BNFC.Backend.HaskellSpec
-   BNFC.OptionsSpec
-   BNFC.WarningMSpec
-   -- need to be there for alex to work
-   LexBNF
-   ParBNF
+    BNFC.CFSpec
+    BNFC.GetCFSpec
+    BNFC.OptionsSpec
+    BNFC.WarningMSpec
+    BNFC.Hspec
+    BNFC.Backend.BaseSpec
+    BNFC.Backend.Common.MakefileSpec
+    BNFC.Backend.Common.NamedVariablesSpec
+    BNFC.Backend.CPP.NoSTLSpec
+    BNFC.Backend.CPP.STLSpec
+    BNFC.Backend.CSharpSpec
+    BNFC.Backend.CSpec
+    BNFC.Backend.HaskellSpec
+    BNFC.Backend.HaskellGADTSpec
+    BNFC.Backend.Haskell.CFtoHappySpec
+    BNFC.Backend.JavaSpec
+    BNFC.Backend.LatexSpec
+    BNFC.Backend.OCamlSpec
+
+    -- Repetition of modules from main:
+    -----------------------------------
+
+    -- generated by cabal
+    Paths_BNFC
+    -- Generated by bnfc
+    LexBNF
+    ParBNF
+    AbsBNF
+    PrintBNF
+    ErrM
+    -- BNFC core
+    Prelude'
+    BNFC.Utils
+    BNFC.CF
+    BNFC.ToCNFCore
+    BNFC.MultiView
+    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.WarningM
+    Data.Pair
+    BNFC.PrettyPrint
+
+    -- Documentation backends
+    BNFC.Backend.Latex
+    BNFC.Backend.Txt2Tag
+
+    -- Haskell backend
+    BNFC.Backend.Haskell
+    BNFC.Backend.Haskell.ToCNF
+    BNFC.Backend.Haskell.RegToAlex
+    BNFC.Backend.Haskell.CFtoTemplate
+    BNFC.Backend.Haskell.CFtoAlex3
+    BNFC.Backend.Haskell.CFtoAlex2
+    BNFC.Backend.Haskell.CFtoAlex
+    BNFC.Backend.Haskell.CFtoHappy
+    BNFC.Backend.Haskell.CFtoPrinter
+    BNFC.Backend.Haskell.CFtoAbstract
+    BNFC.Backend.Haskell.CFtoLayout
+    BNFC.Backend.Haskell.MkErrM
+    BNFC.Backend.Haskell.MkSharedString
+    BNFC.Backend.Haskell.HsOpts
+    BNFC.Backend.Haskell.Utils
+    -- Profile
+    BNFC.Backend.HaskellProfile
+    BNFC.Backend.HaskellProfile.CFtoHappyProfile
+    -- 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.CFtoCPrinter
+    BNFC.Backend.C.CFtoCSkel
+    BNFC.Backend.C.CFtoBisonC
+    BNFC.Backend.C.CFtoFlexC
+    BNFC.Backend.C.CFtoCAbs
+    BNFC.Backend.CPP.NoSTL.CFtoCVisitSkel
+
+    -- C++ backend
+    BNFC.Backend.CPP.PrettyPrinter
+    BNFC.Backend.CPP.Makefile
+    BNFC.Backend.CPP.Naming
+    BNFC.Backend.CPP.NoSTL
+    BNFC.Backend.CPP.NoSTL.RegToFlex
+    BNFC.Backend.CPP.NoSTL.CFtoFlex
+    BNFC.Backend.CPP.NoSTL.CFtoBison
+    BNFC.Backend.CPP.NoSTL.CFtoCPPAbs
+
+    -- C++ STL backend
+    BNFC.Backend.CPP.STL
+    BNFC.Backend.CPP.STL.CFtoBisonSTL
+    BNFC.Backend.CPP.STL.CFtoSTLAbs
+    BNFC.Backend.CPP.STL.STLUtils
+    BNFC.Backend.CPP.STL.CFtoCVisitSkelSTL
+
+    -- C# backend
+    BNFC.Backend.CSharp
+    BNFC.Backend.CSharp.RegToGPLEX
+    BNFC.Backend.CSharp.CFtoGPLEX
+    BNFC.Backend.CSharp.CSharpUtils
+    BNFC.Backend.CSharp.CFtoCSharpPrinter
+    BNFC.Backend.CSharp.CAbstoCSharpAbs
+    BNFC.Backend.CSharp.CAbstoCSharpAbstractVisitSkeleton
+    BNFC.Backend.CSharp.CAbstoCSharpVisitSkeleton
+    BNFC.Backend.CSharp.CFtoGPPG
+
+    -- 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
+
 
 Test-suite bnfc-doctests
   type:           exitcode-stdio-1.0
diff --git a/LICENSE b/LICENSE
--- a/LICENSE
+++ b/LICENSE
@@ -2,7 +2,7 @@
 		       Version 2, June 1991
 
  Copyright (C) 1989, 1991 Free Software Foundation, Inc.
-                       59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+                   51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
  Everyone is permitted to copy and distribute verbatim copies
  of this license document, but changing it is not allowed.
 
@@ -305,7 +305,7 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 
 
 Also add information on how to contact you by electronic and paper mail.
diff --git a/Makefile b/Makefile
new file mode 100644
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,43 @@
+BNFC_VERSION=$(shell sed -ne "s/^[Vv]ersion: *\([0-9.]*\).*/\1/p" BNFC.cabal)
+
+# Cabal options (to be overwritten from the command line)
+CABAL_OPTS=
+
+# Name for binary distribution (e.g. bnfc-2.4.5-linux32)
+BDIST_TAG=bnfc-${BNFC_VERSION}-$(shell uname -s)-$(shell uname -m)
+
+.PHONY: build install doc test
+
+all: build
+
+build:
+	cabal configure && cabal build
+
+install:
+	cabal install
+
+test:
+	cabal configure --enable-tests
+	cabal test
+
+doc:
+	cabal haddock --executables --internal
+
+# Binary package (tgz, for linux)
+bdist: dist/${BDIST_TAG}.tar.gz
+.PHONY: bdist
+
+dist/%.tar.gz:
+	cabal clean
+	cabal install ${CABAL_OPTS} --only-dependencies
+	cabal configure ${CABAL_OPTS} --prefix=/
+	cabal build ${CABAL_OPTS}
+	cabal copy --destdir=dist/install
+	mkdir dist/$*
+	cp dist/install/bin/bnfc dist/$*
+	cp LICENSE dist/$*
+	tar -cvz -C dist $* > $@
+
+# Print the bnfc version from the cabal file
+show-version:
+	@echo ${BNFC_VERSION}
diff --git a/changelog b/changelog
--- a/changelog
+++ b/changelog
@@ -1,3 +1,29 @@
+2.8.2 Andreas Abel <andreas.abel@gu.se>  November 2018
+	* GHC 8.4 compatibility [#227,#236]
+	* bnfc now puts current timestamp on all created files, even unchanged ones [#219]
+	* bnfc is now more accepting about border-line terminals [#149]
+	* Improved error messages [#144] in particular on undefined categories [#151]
+	* C: Emit correct function prototypes [#185]
+	* C++: Fix buffer overrun in pretty printer [#242]
+	* C++: Fix regression introduced in 2.8 in Skeleton.H [#164]
+	* C++: Replace `%name-prefix` with `%define api.prefix` in bison files [#181]
+	* C++: Fix a bug that appeared if you had a category named "List"
+	* C, C++: Add usage output to the test program [#141]
+	* C, C++: Fix a bug in the parser file when using -p [#172]
+	* C, C++, OCaml, Java: Accept ' or " as comment delimiters [#146]
+	* Haskell: Generated code mostly hlint-warning free
+	* Haskell: Small fixes [#166,#170,#222]
+	* Java: Add an experimental ANTLR4 backend [#155]
+	* Java: Add support for passing line numbers to parser [#217,#224,#226]
+	* OCaml: Reserved symbols now have a higher precedence than predefined
+	  tokens as in Haskell
+	* Some updates of the documentation [#211,#223]
+	* And various small fixes [#139,#159,#195,#201,#215]
+
+2.8.1 Grégoire Détrez <gregoire.detrez@gu.se>  February 2016
+	* Fix compatibility with GHC 7.10.2 and Alex 3.14
+	* Fixed #160
+
 2.8 Grégoire Détrez <gregoire.detrez@gu.se>  May 2015
 	* Builds with ghc 7.10.1
 	* Add support for JFlex (java)
diff --git a/compat/Prelude'.hs b/compat/Prelude'.hs
new file mode 100644
--- /dev/null
+++ b/compat/Prelude'.hs
@@ -0,0 +1,15 @@
+{-# LANGUAGE CPP #-}
+
+-- See #227 for what's going on here.
+
+module Prelude'
+(
+  module P
+)
+where
+
+#if __GLASGOW_HASKELL__ >= 803
+import Prelude as P hiding ((<>))
+#else
+import Prelude as P
+#endif
diff --git a/dist/build/bnfc/bnfc-tmp/LexBNF.hs b/dist/build/bnfc/bnfc-tmp/LexBNF.hs
--- a/dist/build/bnfc/bnfc-tmp/LexBNF.hs
+++ b/dist/build/bnfc/bnfc-tmp/LexBNF.hs
@@ -1,3 +1,4 @@
+{-# OPTIONS_GHC -fno-warn-unused-binds -fno-warn-missing-signatures #-}
 {-# LANGUAGE CPP,MagicHash #-}
 {-# LINE 3 "src/LexBNF.x" #-}
 
@@ -18,30 +19,90 @@
 #endif
 #if __GLASGOW_HASKELL__ >= 503
 import Data.Array
-import Data.Char (ord)
 import Data.Array.Base (unsafeAt)
 #else
 import Array
-import Char (ord)
 #endif
 #if __GLASGOW_HASKELL__ >= 503
 import GHC.Exts
 #else
 import GlaExts
 #endif
+alex_tab_size :: Int
+alex_tab_size = 8
 alex_base :: AlexAddr
-alex_base = AlexA# "\xf8\xff\xff\xff\x49\x00\x00\x00\xc9\xff\xff\xff\xe0\xff\xff\xff\xc9\x00\x00\x00\x9c\x01\x00\x00\x2d\x00\x00\x00\x1c\x02\x00\x00\x1c\x03\x00\x00\x0a\x01\x00\x00\x00\x00\x00\x00\x0d\x03\x00\x00\x0d\x04\x00\x00\xcd\x03\x00\x00\xcd\x04\x00\x00\x91\x05\x00\x00\xef\x05\x00\x00\x8d\x04\x00\x00\x00\x00\x00\x00\xa5\x05\x00\x00\xdb\xff\xff\xff\x47\x00\x00\x00\x5a\x00\x00\x00\xa5\x06\x00\x00\xa6\x06\x00\x00\x69\x07\x00\x00\x29\x07\x00\x00\x00\x00\x00\x00\x1f\x08\x00\x00\x00\x00\x00\x00\x78\x00\x00\x00\xdc\xff\xff\xff\xdd\xff\xff\xff\x00\x00\x00\x00\xdf\xff\xff\xff\xf8\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x72\x00\x00\x00\xe7\x05\x00\x00\x7c\x00\x00\x00"#
+alex_base = AlexA#
+  "\xf8\xff\xff\xff\x49\x00\x00\x00\xc9\xff\xff\xff\xe0\xff\xff\xff\xc9\x00\x00\x00\x9c\x01\x00\x00\x2d\x00\x00\x00\x1c\x02\x00\x00\x1c\x03\x00\x00\x0a\x01\x00\x00\x00\x00\x00\x00\x0d\x03\x00\x00\x0d\x04\x00\x00\xcd\x03\x00\x00\xcd\x04\x00\x00\x91\x05\x00\x00\xef\x05\x00\x00\x8d\x04\x00\x00\x00\x00\x00\x00\xa5\x05\x00\x00\xdb\xff\xff\xff\x47\x00\x00\x00\x5a\x00\x00\x00\xa5\x06\x00\x00\xa6\x06\x00\x00\x69\x07\x00\x00\x29\x07\x00\x00\x00\x00\x00\x00\x1f\x08\x00\x00\x00\x00\x00\x00\x78\x00\x00\x00\xdc\xff\xff\xff\xdd\xff\xff\xff\x00\x00\x00\x00\xdf\xff\xff\xff\xf8\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x72\x00\x00\x00\xe7\x05\x00\x00\x7c\x00\x00\x00"#
 
 alex_table :: AlexAddr
-alex_table = AlexA# "\x00\x00\x1e\x00\x1e\x00\x1e\x00\x1e\x00\x1e\x00\x21\x00\x25\x00\x16\x00\x1c\x00\x05\x00\x28\x00\x28\x00\x28\x00\x28\x00\x28\x00\x28\x00\x28\x00\x28\x00\x28\x00\x28\x00\x00\x00\x00\x00\x00\x00\x1e\x00\x02\x00\x17\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0e\x00\x21\x00\x21\x00\x21\x00\x21\x00\x21\x00\x1f\x00\x21\x00\x00\x00\x26\x00\x26\x00\x26\x00\x26\x00\x26\x00\x26\x00\x26\x00\x26\x00\x26\x00\x26\x00\x22\x00\x21\x00\x00\x00\x21\x00\x00\x00\x21\x00\x00\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x21\x00\x03\x00\x21\x00\x00\x00\x21\x00\x00\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x20\x00\x21\x00\x21\x00\x01\x00\x27\x00\x27\x00\x27\x00\x27\x00\x27\x00\x27\x00\x27\x00\x27\x00\x27\x00\x27\x00\x1e\x00\x1e\x00\x1e\x00\x1e\x00\x1e\x00\x00\x00\x00\x00\x00\x00\x03\x00\x28\x00\x28\x00\x28\x00\x28\x00\x28\x00\x28\x00\x28\x00\x28\x00\x28\x00\x28\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1e\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x15\x00\x03\x00\x26\x00\x26\x00\x26\x00\x26\x00\x26\x00\x26\x00\x26\x00\x26\x00\x26\x00\x26\x00\x28\x00\x28\x00\x28\x00\x28\x00\x28\x00\x28\x00\x28\x00\x28\x00\x28\x00\x28\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x18\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1d\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x08\x00\x09\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x19\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x01\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x08\x00\x09\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x04\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x13\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x00\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x06\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x0c\x00\x0d\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x17\x00\x00\x00\x00\x00\x00\x00\x00\x00\x17\x00\x27\x00\x27\x00\x27\x00\x27\x00\x27\x00\x27\x00\x27\x00\x27\x00\x27\x00\x27\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x17\x00\x14\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x17\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x17\x00\x1a\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x00\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x24\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x10\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x00\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x00\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x00\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x00\x00\x0f\x00\x11\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x19\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1a\x00\x04\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x13\x00\x07\x00\x0a\x00\x0a\x00\x0a\x00\x0b\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x23\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x00\x00\x00\x00\x00\x00\x00\x00\x23\x00\x00\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x18\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"#
+alex_table = AlexA#
+  "\x00\x00\x1e\x00\x1e\x00\x1e\x00\x1e\x00\x1e\x00\x21\x00\x25\x00\x16\x00\x1c\x00\x05\x00\x28\x00\x28\x00\x28\x00\x28\x00\x28\x00\x28\x00\x28\x00\x28\x00\x28\x00\x28\x00\x00\x00\x00\x00\x00\x00\x1e\x00\x02\x00\x17\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0e\x00\x21\x00\x21\x00\x21\x00\x21\x00\x21\x00\x1f\x00\x21\x00\x00\x00\x26\x00\x26\x00\x26\x00\x26\x00\x26\x00\x26\x00\x26\x00\x26\x00\x26\x00\x26\x00\x22\x00\x21\x00\x00\x00\x21\x00\x00\x00\x21\x00\x00\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x21\x00\x03\x00\x21\x00\x00\x00\x21\x00\x00\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x20\x00\x21\x00\x21\x00\x01\x00\x27\x00\x27\x00\x27\x00\x27\x00\x27\x00\x27\x00\x27\x00\x27\x00\x27\x00\x27\x00\x1e\x00\x1e\x00\x1e\x00\x1e\x00\x1e\x00\x00\x00\x00\x00\x00\x00\x03\x00\x28\x00\x28\x00\x28\x00\x28\x00\x28\x00\x28\x00\x28\x00\x28\x00\x28\x00\x28\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1e\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x15\x00\x03\x00\x26\x00\x26\x00\x26\x00\x26\x00\x26\x00\x26\x00\x26\x00\x26\x00\x26\x00\x26\x00\x28\x00\x28\x00\x28\x00\x28\x00\x28\x00\x28\x00\x28\x00\x28\x00\x28\x00\x28\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x18\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1d\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x08\x00\x09\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x19\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x01\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x08\x00\x09\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x04\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x13\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x00\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x06\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x0c\x00\x0d\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x17\x00\x00\x00\x00\x00\x00\x00\x00\x00\x17\x00\x27\x00\x27\x00\x27\x00\x27\x00\x27\x00\x27\x00\x27\x00\x27\x00\x27\x00\x27\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x17\x00\x14\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x17\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x17\x00\x1a\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x00\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x24\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x10\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x00\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x00\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x00\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x00\x00\x0f\x00\x11\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x19\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1a\x00\x04\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x13\x00\x07\x00\x0a\x00\x0a\x00\x0a\x00\x0b\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x23\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x00\x00\x00\x00\x00\x00\x00\x00\x23\x00\x00\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x18\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"#
 
 alex_check :: AlexAddr
-alex_check = AlexA# "\xff\xff\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x3d\x00\x27\x00\x2d\x00\x2d\x00\x2d\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\xff\xff\xff\xff\x20\x00\x3a\x00\x22\x00\xff\xff\xff\xff\xff\xff\xff\xff\x27\x00\x28\x00\x29\x00\x2a\x00\x2b\x00\x2c\x00\x2d\x00\x2e\x00\xff\xff\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\xff\xff\x3d\x00\xff\xff\x3f\x00\xff\xff\x41\x00\x42\x00\x43\x00\x44\x00\x45\x00\x46\x00\x47\x00\x48\x00\x49\x00\x4a\x00\x4b\x00\x4c\x00\x4d\x00\x4e\x00\x4f\x00\x50\x00\x51\x00\x52\x00\x53\x00\x54\x00\x55\x00\x56\x00\x57\x00\x58\x00\x59\x00\x5a\x00\x5b\x00\x27\x00\x5d\x00\xff\xff\x5f\x00\xff\xff\x61\x00\x62\x00\x63\x00\x64\x00\x65\x00\x66\x00\x67\x00\x68\x00\x69\x00\x6a\x00\x6b\x00\x6c\x00\x6d\x00\x6e\x00\x6f\x00\x70\x00\x71\x00\x72\x00\x73\x00\x74\x00\x75\x00\x76\x00\x77\x00\x78\x00\x79\x00\x7a\x00\x7b\x00\x7c\x00\x7d\x00\x2d\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\xff\xff\xff\xff\xff\xff\x5c\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\xff\xff\xff\xff\xff\xff\x20\x00\xff\xff\xff\xff\x6e\x00\xff\xff\xff\xff\xff\xff\xff\xff\x2e\x00\x74\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc3\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x7d\x00\xff\xff\xff\xff\x80\x00\x81\x00\x82\x00\x83\x00\x84\x00\x85\x00\x86\x00\x87\x00\x88\x00\x89\x00\x8a\x00\x8b\x00\x8c\x00\x8d\x00\x8e\x00\x8f\x00\x90\x00\x91\x00\x92\x00\x93\x00\x94\x00\x95\x00\x96\x00\x97\x00\x98\x00\x99\x00\x9a\x00\x9b\x00\x9c\x00\x9d\x00\x9e\x00\x9f\x00\xa0\x00\xa1\x00\xa2\x00\xa3\x00\xa4\x00\xa5\x00\xa6\x00\xa7\x00\xa8\x00\xa9\x00\xaa\x00\xab\x00\xac\x00\xad\x00\xae\x00\xaf\x00\xb0\x00\xb1\x00\xb2\x00\xb3\x00\xb4\x00\xb5\x00\xb6\x00\xb7\x00\xb8\x00\xb9\x00\xba\x00\xbb\x00\xbc\x00\xbd\x00\xbe\x00\xbf\x00\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\xd7\x00\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\xf7\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00\x80\x00\x81\x00\x82\x00\x83\x00\x84\x00\x85\x00\x86\x00\x87\x00\x88\x00\x89\x00\x8a\x00\x8b\x00\x8c\x00\x8d\x00\x8e\x00\x8f\x00\x90\x00\x91\x00\x92\x00\x93\x00\x94\x00\x95\x00\x96\x00\x97\x00\x98\x00\x99\x00\x9a\x00\x9b\x00\x9c\x00\x9d\x00\x9e\x00\x9f\x00\xa0\x00\xa1\x00\xa2\x00\xa3\x00\xa4\x00\xa5\x00\xa6\x00\xa7\x00\xa8\x00\xa9\x00\xaa\x00\xab\x00\xac\x00\xad\x00\xae\x00\xaf\x00\xb0\x00\xb1\x00\xb2\x00\xb3\x00\xb4\x00\xb5\x00\xb6\x00\xb7\x00\xb8\x00\xb9\x00\xba\x00\xbb\x00\xbc\x00\xbd\x00\xbe\x00\xbf\x00\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\xd7\x00\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\xf7\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00\x2d\x00\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\xd7\x00\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\xf7\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x80\x00\x81\x00\x82\x00\x83\x00\x84\x00\x85\x00\x86\x00\x87\x00\x88\x00\x89\x00\x8a\x00\x8b\x00\x8c\x00\x8d\x00\x8e\x00\x8f\x00\x90\x00\x91\x00\x92\x00\x93\x00\x94\x00\x95\x00\x96\x00\x97\x00\x98\x00\x99\x00\x9a\x00\x9b\x00\x9c\x00\x9d\x00\x9e\x00\x9f\x00\xa0\x00\xa1\x00\xa2\x00\xa3\x00\xa4\x00\xa5\x00\xa6\x00\xa7\x00\xa8\x00\xa9\x00\xaa\x00\xab\x00\xac\x00\xad\x00\xae\x00\xaf\x00\xb0\x00\xb1\x00\xb2\x00\xb3\x00\xb4\x00\xb5\x00\xb6\x00\xb7\x00\xb8\x00\xb9\x00\xba\x00\xbb\x00\xbc\x00\xbd\x00\xbe\x00\xbf\x00\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\xd7\x00\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\xf7\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00\x80\x00\x81\x00\x82\x00\x83\x00\x84\x00\x85\x00\x86\x00\x87\x00\x88\x00\x89\x00\x8a\x00\x8b\x00\x8c\x00\x8d\x00\x8e\x00\x8f\x00\x90\x00\x91\x00\x92\x00\x93\x00\x94\x00\x95\x00\x96\x00\x97\x00\x98\x00\x99\x00\x9a\x00\x9b\x00\x9c\x00\x9d\x00\x9e\x00\x9f\x00\xa0\x00\xa1\x00\xa2\x00\xa3\x00\xa4\x00\xa5\x00\xa6\x00\xa7\x00\xa8\x00\xa9\x00\xaa\x00\xab\x00\xac\x00\xad\x00\xae\x00\xaf\x00\xb0\x00\xb1\x00\xb2\x00\xb3\x00\xb4\x00\xb5\x00\xb6\x00\xb7\x00\xb8\x00\xb9\x00\xba\x00\xbb\x00\xbc\x00\xbd\x00\xbe\x00\xbf\x00\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\xd7\x00\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\xf7\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\x2b\x00\x2c\x00\x2d\x00\x2e\x00\x2f\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x3e\x00\x3f\x00\x40\x00\x41\x00\x42\x00\x43\x00\x44\x00\x45\x00\x46\x00\x47\x00\x48\x00\x49\x00\x4a\x00\x4b\x00\x4c\x00\x4d\x00\x4e\x00\x4f\x00\x50\x00\x51\x00\x52\x00\x53\x00\x54\x00\x55\x00\x56\x00\x57\x00\x58\x00\x59\x00\x5a\x00\x5b\x00\x5c\x00\x5d\x00\x5e\x00\x5f\x00\x60\x00\x61\x00\x62\x00\x63\x00\x64\x00\x65\x00\x66\x00\x67\x00\x68\x00\x69\x00\x6a\x00\x6b\x00\x6c\x00\x6d\x00\x6e\x00\x6f\x00\x70\x00\x71\x00\x72\x00\x73\x00\x74\x00\x75\x00\x76\x00\x77\x00\x78\x00\x79\x00\x7a\x00\x7b\x00\x7c\x00\x7d\x00\x7e\x00\x7f\x00\x8f\x00\x90\x00\x91\x00\x92\x00\x93\x00\x94\x00\x95\x00\x96\x00\x97\x00\x98\x00\x99\x00\x9a\x00\x9b\x00\x9c\x00\x9d\x00\x9e\x00\x9f\x00\xa0\x00\xa1\x00\xa2\x00\xa3\x00\xa4\x00\xa5\x00\xa6\x00\xa7\x00\xa8\x00\xa9\x00\xaa\x00\xab\x00\xac\x00\xad\x00\xae\x00\xaf\x00\xb0\x00\xb1\x00\xb2\x00\xb3\x00\xb4\x00\xb5\x00\xb6\x00\xb7\x00\xb8\x00\xb9\x00\xba\x00\xbb\x00\xbc\x00\xbd\x00\xbe\x00\xbf\x00\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\xd7\x00\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\xf7\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\x2b\x00\x2c\x00\x2d\x00\x2e\x00\x2f\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x3e\x00\x3f\x00\x40\x00\x41\x00\x42\x00\x43\x00\x44\x00\x45\x00\x46\x00\x47\x00\x48\x00\x49\x00\x4a\x00\x4b\x00\x4c\x00\x4d\x00\x4e\x00\x4f\x00\x50\x00\x51\x00\x52\x00\x53\x00\x54\x00\x55\x00\x56\x00\x57\x00\x58\x00\x59\x00\x5a\x00\x5b\x00\x5c\x00\x5d\x00\x5e\x00\x5f\x00\x60\x00\x61\x00\x62\x00\x63\x00\x64\x00\x65\x00\x66\x00\x67\x00\x68\x00\x69\x00\x6a\x00\x6b\x00\x6c\x00\x6d\x00\x6e\x00\x6f\x00\x70\x00\x71\x00\x72\x00\x73\x00\x74\x00\x75\x00\x76\x00\x77\x00\x78\x00\x79\x00\x7a\x00\x7b\x00\x7c\x00\x7d\x00\x7e\x00\x7f\x00\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\xd7\x00\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\xf7\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\xff\xff\x28\x00\x29\x00\x2a\x00\x2b\x00\x2c\x00\x2d\x00\x2e\x00\x2f\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x3e\x00\x3f\x00\x40\x00\x41\x00\x42\x00\x43\x00\x44\x00\x45\x00\x46\x00\x47\x00\x48\x00\x49\x00\x4a\x00\x4b\x00\x4c\x00\x4d\x00\x4e\x00\x4f\x00\x50\x00\x51\x00\x52\x00\x53\x00\x54\x00\x55\x00\x56\x00\x57\x00\x58\x00\x59\x00\x5a\x00\x5b\x00\x5c\x00\x5d\x00\x5e\x00\x5f\x00\x60\x00\x61\x00\x62\x00\x63\x00\x64\x00\x65\x00\x66\x00\x67\x00\x68\x00\x69\x00\x6a\x00\x6b\x00\x6c\x00\x6d\x00\x6e\x00\x6f\x00\x70\x00\x71\x00\x72\x00\x73\x00\x74\x00\x75\x00\x76\x00\x77\x00\x78\x00\x79\x00\x7a\x00\x7b\x00\x7c\x00\x7d\x00\x7e\x00\x7f\x00\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\xd7\x00\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\xf7\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00\xff\xff\xff\xff\xc2\x00\xc3\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\x2b\x00\x2c\x00\x2d\x00\x2e\x00\x2f\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x3e\x00\x3f\x00\x40\x00\x41\x00\x42\x00\x43\x00\x44\x00\x45\x00\x46\x00\x47\x00\x48\x00\x49\x00\x4a\x00\x4b\x00\x4c\x00\x4d\x00\x4e\x00\x4f\x00\x50\x00\x51\x00\x52\x00\x53\x00\x54\x00\x55\x00\x56\x00\x57\x00\x58\x00\x59\x00\x5a\x00\x5b\x00\x5c\x00\x5d\x00\x5e\x00\x5f\x00\x60\x00\x61\x00\x62\x00\x63\x00\x64\x00\x65\x00\x66\x00\x67\x00\x68\x00\x69\x00\x6a\x00\x6b\x00\x6c\x00\x6d\x00\x6e\x00\x6f\x00\x70\x00\x71\x00\x72\x00\x73\x00\x74\x00\x75\x00\x76\x00\x77\x00\x78\x00\x79\x00\x7a\x00\x7b\x00\x7c\x00\x7d\x00\x7e\x00\x7f\x00\x22\x00\xff\xff\xff\xff\xff\xff\xff\xff\x27\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x5c\x00\x65\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x6e\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x74\x00\xbf\x00\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\xd7\x00\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\xf7\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x09\x00\xff\xff\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\x2b\x00\x2c\x00\x2d\x00\x2e\x00\x2f\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x3e\x00\x3f\x00\x40\x00\x41\x00\x42\x00\x43\x00\x44\x00\x45\x00\x46\x00\x47\x00\x48\x00\x49\x00\x4a\x00\x4b\x00\x4c\x00\x4d\x00\x4e\x00\x4f\x00\x50\x00\x51\x00\x52\x00\x53\x00\x54\x00\x55\x00\x56\x00\x57\x00\x58\x00\x59\x00\x5a\x00\x5b\x00\x5c\x00\x5d\x00\x5e\x00\x5f\x00\x60\x00\x61\x00\x62\x00\x63\x00\x64\x00\x65\x00\x66\x00\x67\x00\x68\x00\x69\x00\x6a\x00\x6b\x00\x6c\x00\x6d\x00\x6e\x00\x6f\x00\x70\x00\x71\x00\x72\x00\x73\x00\x74\x00\x75\x00\x76\x00\x77\x00\x78\x00\x79\x00\x7a\x00\x7b\x00\x7c\x00\x7d\x00\x7e\x00\x7f\x00\xff\xff\x80\x00\x81\x00\x82\x00\x83\x00\x84\x00\x85\x00\x86\x00\x87\x00\x88\x00\x89\x00\x8a\x00\x8b\x00\x8c\x00\x8d\x00\x8e\x00\x8f\x00\x90\x00\x91\x00\x92\x00\x93\x00\x94\x00\x95\x00\x96\x00\xff\xff\x98\x00\x99\x00\x9a\x00\x9b\x00\x9c\x00\x9d\x00\x9e\x00\x9f\x00\xa0\x00\xa1\x00\xa2\x00\xa3\x00\xa4\x00\xa5\x00\xa6\x00\xa7\x00\xa8\x00\xa9\x00\xaa\x00\xab\x00\xac\x00\xad\x00\xae\x00\xaf\x00\xb0\x00\xb1\x00\xb2\x00\xb3\x00\xb4\x00\xb5\x00\xb6\x00\xff\xff\xb8\x00\xb9\x00\xba\x00\xbb\x00\xbc\x00\xbd\x00\xbe\x00\xbf\x00\xff\xff\xc2\x00\xc3\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\x2b\x00\x2c\x00\x2d\x00\x2e\x00\x2f\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x3e\x00\x3f\x00\x40\x00\x41\x00\x42\x00\x43\x00\x44\x00\x45\x00\x46\x00\x47\x00\x48\x00\x49\x00\x4a\x00\x4b\x00\x4c\x00\x4d\x00\x4e\x00\x4f\x00\x50\x00\x51\x00\x52\x00\x53\x00\x54\x00\x55\x00\x56\x00\x57\x00\x58\x00\x59\x00\x5a\x00\x5b\x00\x5c\x00\x5d\x00\x5e\x00\x5f\x00\x60\x00\x61\x00\x62\x00\x63\x00\x64\x00\x65\x00\x66\x00\x67\x00\x68\x00\x69\x00\x6a\x00\x6b\x00\x6c\x00\x6d\x00\x6e\x00\x6f\x00\x70\x00\x71\x00\x72\x00\x73\x00\x74\x00\x75\x00\x76\x00\x77\x00\x78\x00\x79\x00\x7a\x00\x7b\x00\x7c\x00\x7d\x00\x7e\x00\x7f\x00\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\xd7\x00\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\xf7\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00\x0a\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x80\x00\x81\x00\x82\x00\x83\x00\x84\x00\x85\x00\x86\x00\x87\x00\x88\x00\x89\x00\x8a\x00\x8b\x00\x8c\x00\x8d\x00\x8e\x00\x8f\x00\x90\x00\x91\x00\x92\x00\x93\x00\x94\x00\x95\x00\x96\x00\x97\x00\x98\x00\x99\x00\x9a\x00\x9b\x00\x9c\x00\x9d\x00\x9e\x00\x9f\x00\xa0\x00\xa1\x00\xa2\x00\xa3\x00\xa4\x00\xa5\x00\xa6\x00\xa7\x00\xa8\x00\xa9\x00\xaa\x00\xab\x00\xac\x00\xad\x00\xae\x00\xaf\x00\xb0\x00\xb1\x00\xb2\x00\xb3\x00\xb4\x00\xb5\x00\xb6\x00\xb7\x00\xb8\x00\xb9\x00\xba\x00\xbb\x00\xbc\x00\xbd\x00\xbe\x00\xbf\x00\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\xd7\x00\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\xf7\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00\x27\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x41\x00\x42\x00\x43\x00\x44\x00\x45\x00\x46\x00\x47\x00\x48\x00\x49\x00\x4a\x00\x4b\x00\x4c\x00\x4d\x00\x4e\x00\x4f\x00\x50\x00\x51\x00\x52\x00\x53\x00\x54\x00\x55\x00\x56\x00\x57\x00\x58\x00\x59\x00\x5a\x00\xff\xff\xff\xff\xff\xff\xff\xff\x5f\x00\xff\xff\x61\x00\x62\x00\x63\x00\x64\x00\x65\x00\x66\x00\x67\x00\x68\x00\x69\x00\x6a\x00\x6b\x00\x6c\x00\x6d\x00\x6e\x00\x6f\x00\x70\x00\x71\x00\x72\x00\x73\x00\x74\x00\x75\x00\x76\x00\x77\x00\x78\x00\x79\x00\x7a\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc3\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"#
+alex_check = AlexA#
+  "\xff\xff\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x3d\x00\x27\x00\x2d\x00\x2d\x00\x2d\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\xff\xff\xff\xff\x20\x00\x3a\x00\x22\x00\xff\xff\xff\xff\xff\xff\xff\xff\x27\x00\x28\x00\x29\x00\x2a\x00\x2b\x00\x2c\x00\x2d\x00\x2e\x00\xff\xff\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\xff\xff\x3d\x00\xff\xff\x3f\x00\xff\xff\x41\x00\x42\x00\x43\x00\x44\x00\x45\x00\x46\x00\x47\x00\x48\x00\x49\x00\x4a\x00\x4b\x00\x4c\x00\x4d\x00\x4e\x00\x4f\x00\x50\x00\x51\x00\x52\x00\x53\x00\x54\x00\x55\x00\x56\x00\x57\x00\x58\x00\x59\x00\x5a\x00\x5b\x00\x27\x00\x5d\x00\xff\xff\x5f\x00\xff\xff\x61\x00\x62\x00\x63\x00\x64\x00\x65\x00\x66\x00\x67\x00\x68\x00\x69\x00\x6a\x00\x6b\x00\x6c\x00\x6d\x00\x6e\x00\x6f\x00\x70\x00\x71\x00\x72\x00\x73\x00\x74\x00\x75\x00\x76\x00\x77\x00\x78\x00\x79\x00\x7a\x00\x7b\x00\x7c\x00\x7d\x00\x2d\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\xff\xff\xff\xff\xff\xff\x5c\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\xff\xff\xff\xff\xff\xff\x20\x00\xff\xff\xff\xff\x6e\x00\xff\xff\xff\xff\xff\xff\xff\xff\x2e\x00\x74\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc3\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x7d\x00\xff\xff\xff\xff\x80\x00\x81\x00\x82\x00\x83\x00\x84\x00\x85\x00\x86\x00\x87\x00\x88\x00\x89\x00\x8a\x00\x8b\x00\x8c\x00\x8d\x00\x8e\x00\x8f\x00\x90\x00\x91\x00\x92\x00\x93\x00\x94\x00\x95\x00\x96\x00\x97\x00\x98\x00\x99\x00\x9a\x00\x9b\x00\x9c\x00\x9d\x00\x9e\x00\x9f\x00\xa0\x00\xa1\x00\xa2\x00\xa3\x00\xa4\x00\xa5\x00\xa6\x00\xa7\x00\xa8\x00\xa9\x00\xaa\x00\xab\x00\xac\x00\xad\x00\xae\x00\xaf\x00\xb0\x00\xb1\x00\xb2\x00\xb3\x00\xb4\x00\xb5\x00\xb6\x00\xb7\x00\xb8\x00\xb9\x00\xba\x00\xbb\x00\xbc\x00\xbd\x00\xbe\x00\xbf\x00\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\xd7\x00\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\xf7\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00\x80\x00\x81\x00\x82\x00\x83\x00\x84\x00\x85\x00\x86\x00\x87\x00\x88\x00\x89\x00\x8a\x00\x8b\x00\x8c\x00\x8d\x00\x8e\x00\x8f\x00\x90\x00\x91\x00\x92\x00\x93\x00\x94\x00\x95\x00\x96\x00\x97\x00\x98\x00\x99\x00\x9a\x00\x9b\x00\x9c\x00\x9d\x00\x9e\x00\x9f\x00\xa0\x00\xa1\x00\xa2\x00\xa3\x00\xa4\x00\xa5\x00\xa6\x00\xa7\x00\xa8\x00\xa9\x00\xaa\x00\xab\x00\xac\x00\xad\x00\xae\x00\xaf\x00\xb0\x00\xb1\x00\xb2\x00\xb3\x00\xb4\x00\xb5\x00\xb6\x00\xb7\x00\xb8\x00\xb9\x00\xba\x00\xbb\x00\xbc\x00\xbd\x00\xbe\x00\xbf\x00\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\xd7\x00\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\xf7\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00\x2d\x00\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\xd7\x00\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\xf7\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x80\x00\x81\x00\x82\x00\x83\x00\x84\x00\x85\x00\x86\x00\x87\x00\x88\x00\x89\x00\x8a\x00\x8b\x00\x8c\x00\x8d\x00\x8e\x00\x8f\x00\x90\x00\x91\x00\x92\x00\x93\x00\x94\x00\x95\x00\x96\x00\x97\x00\x98\x00\x99\x00\x9a\x00\x9b\x00\x9c\x00\x9d\x00\x9e\x00\x9f\x00\xa0\x00\xa1\x00\xa2\x00\xa3\x00\xa4\x00\xa5\x00\xa6\x00\xa7\x00\xa8\x00\xa9\x00\xaa\x00\xab\x00\xac\x00\xad\x00\xae\x00\xaf\x00\xb0\x00\xb1\x00\xb2\x00\xb3\x00\xb4\x00\xb5\x00\xb6\x00\xb7\x00\xb8\x00\xb9\x00\xba\x00\xbb\x00\xbc\x00\xbd\x00\xbe\x00\xbf\x00\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\xd7\x00\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\xf7\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00\x80\x00\x81\x00\x82\x00\x83\x00\x84\x00\x85\x00\x86\x00\x87\x00\x88\x00\x89\x00\x8a\x00\x8b\x00\x8c\x00\x8d\x00\x8e\x00\x8f\x00\x90\x00\x91\x00\x92\x00\x93\x00\x94\x00\x95\x00\x96\x00\x97\x00\x98\x00\x99\x00\x9a\x00\x9b\x00\x9c\x00\x9d\x00\x9e\x00\x9f\x00\xa0\x00\xa1\x00\xa2\x00\xa3\x00\xa4\x00\xa5\x00\xa6\x00\xa7\x00\xa8\x00\xa9\x00\xaa\x00\xab\x00\xac\x00\xad\x00\xae\x00\xaf\x00\xb0\x00\xb1\x00\xb2\x00\xb3\x00\xb4\x00\xb5\x00\xb6\x00\xb7\x00\xb8\x00\xb9\x00\xba\x00\xbb\x00\xbc\x00\xbd\x00\xbe\x00\xbf\x00\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\xd7\x00\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\xf7\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\x2b\x00\x2c\x00\x2d\x00\x2e\x00\x2f\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x3e\x00\x3f\x00\x40\x00\x41\x00\x42\x00\x43\x00\x44\x00\x45\x00\x46\x00\x47\x00\x48\x00\x49\x00\x4a\x00\x4b\x00\x4c\x00\x4d\x00\x4e\x00\x4f\x00\x50\x00\x51\x00\x52\x00\x53\x00\x54\x00\x55\x00\x56\x00\x57\x00\x58\x00\x59\x00\x5a\x00\x5b\x00\x5c\x00\x5d\x00\x5e\x00\x5f\x00\x60\x00\x61\x00\x62\x00\x63\x00\x64\x00\x65\x00\x66\x00\x67\x00\x68\x00\x69\x00\x6a\x00\x6b\x00\x6c\x00\x6d\x00\x6e\x00\x6f\x00\x70\x00\x71\x00\x72\x00\x73\x00\x74\x00\x75\x00\x76\x00\x77\x00\x78\x00\x79\x00\x7a\x00\x7b\x00\x7c\x00\x7d\x00\x7e\x00\x7f\x00\x8f\x00\x90\x00\x91\x00\x92\x00\x93\x00\x94\x00\x95\x00\x96\x00\x97\x00\x98\x00\x99\x00\x9a\x00\x9b\x00\x9c\x00\x9d\x00\x9e\x00\x9f\x00\xa0\x00\xa1\x00\xa2\x00\xa3\x00\xa4\x00\xa5\x00\xa6\x00\xa7\x00\xa8\x00\xa9\x00\xaa\x00\xab\x00\xac\x00\xad\x00\xae\x00\xaf\x00\xb0\x00\xb1\x00\xb2\x00\xb3\x00\xb4\x00\xb5\x00\xb6\x00\xb7\x00\xb8\x00\xb9\x00\xba\x00\xbb\x00\xbc\x00\xbd\x00\xbe\x00\xbf\x00\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\xd7\x00\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\xf7\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\x2b\x00\x2c\x00\x2d\x00\x2e\x00\x2f\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x3e\x00\x3f\x00\x40\x00\x41\x00\x42\x00\x43\x00\x44\x00\x45\x00\x46\x00\x47\x00\x48\x00\x49\x00\x4a\x00\x4b\x00\x4c\x00\x4d\x00\x4e\x00\x4f\x00\x50\x00\x51\x00\x52\x00\x53\x00\x54\x00\x55\x00\x56\x00\x57\x00\x58\x00\x59\x00\x5a\x00\x5b\x00\x5c\x00\x5d\x00\x5e\x00\x5f\x00\x60\x00\x61\x00\x62\x00\x63\x00\x64\x00\x65\x00\x66\x00\x67\x00\x68\x00\x69\x00\x6a\x00\x6b\x00\x6c\x00\x6d\x00\x6e\x00\x6f\x00\x70\x00\x71\x00\x72\x00\x73\x00\x74\x00\x75\x00\x76\x00\x77\x00\x78\x00\x79\x00\x7a\x00\x7b\x00\x7c\x00\x7d\x00\x7e\x00\x7f\x00\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\xd7\x00\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\xf7\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\xff\xff\x28\x00\x29\x00\x2a\x00\x2b\x00\x2c\x00\x2d\x00\x2e\x00\x2f\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x3e\x00\x3f\x00\x40\x00\x41\x00\x42\x00\x43\x00\x44\x00\x45\x00\x46\x00\x47\x00\x48\x00\x49\x00\x4a\x00\x4b\x00\x4c\x00\x4d\x00\x4e\x00\x4f\x00\x50\x00\x51\x00\x52\x00\x53\x00\x54\x00\x55\x00\x56\x00\x57\x00\x58\x00\x59\x00\x5a\x00\x5b\x00\x5c\x00\x5d\x00\x5e\x00\x5f\x00\x60\x00\x61\x00\x62\x00\x63\x00\x64\x00\x65\x00\x66\x00\x67\x00\x68\x00\x69\x00\x6a\x00\x6b\x00\x6c\x00\x6d\x00\x6e\x00\x6f\x00\x70\x00\x71\x00\x72\x00\x73\x00\x74\x00\x75\x00\x76\x00\x77\x00\x78\x00\x79\x00\x7a\x00\x7b\x00\x7c\x00\x7d\x00\x7e\x00\x7f\x00\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\xd7\x00\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\xf7\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00\xff\xff\xff\xff\xc2\x00\xc3\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\x2b\x00\x2c\x00\x2d\x00\x2e\x00\x2f\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x3e\x00\x3f\x00\x40\x00\x41\x00\x42\x00\x43\x00\x44\x00\x45\x00\x46\x00\x47\x00\x48\x00\x49\x00\x4a\x00\x4b\x00\x4c\x00\x4d\x00\x4e\x00\x4f\x00\x50\x00\x51\x00\x52\x00\x53\x00\x54\x00\x55\x00\x56\x00\x57\x00\x58\x00\x59\x00\x5a\x00\x5b\x00\x5c\x00\x5d\x00\x5e\x00\x5f\x00\x60\x00\x61\x00\x62\x00\x63\x00\x64\x00\x65\x00\x66\x00\x67\x00\x68\x00\x69\x00\x6a\x00\x6b\x00\x6c\x00\x6d\x00\x6e\x00\x6f\x00\x70\x00\x71\x00\x72\x00\x73\x00\x74\x00\x75\x00\x76\x00\x77\x00\x78\x00\x79\x00\x7a\x00\x7b\x00\x7c\x00\x7d\x00\x7e\x00\x7f\x00\x22\x00\xff\xff\xff\xff\xff\xff\xff\xff\x27\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x5c\x00\x65\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x6e\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x74\x00\xbf\x00\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\xd7\x00\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\xf7\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x09\x00\xff\xff\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\x2b\x00\x2c\x00\x2d\x00\x2e\x00\x2f\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x3e\x00\x3f\x00\x40\x00\x41\x00\x42\x00\x43\x00\x44\x00\x45\x00\x46\x00\x47\x00\x48\x00\x49\x00\x4a\x00\x4b\x00\x4c\x00\x4d\x00\x4e\x00\x4f\x00\x50\x00\x51\x00\x52\x00\x53\x00\x54\x00\x55\x00\x56\x00\x57\x00\x58\x00\x59\x00\x5a\x00\x5b\x00\x5c\x00\x5d\x00\x5e\x00\x5f\x00\x60\x00\x61\x00\x62\x00\x63\x00\x64\x00\x65\x00\x66\x00\x67\x00\x68\x00\x69\x00\x6a\x00\x6b\x00\x6c\x00\x6d\x00\x6e\x00\x6f\x00\x70\x00\x71\x00\x72\x00\x73\x00\x74\x00\x75\x00\x76\x00\x77\x00\x78\x00\x79\x00\x7a\x00\x7b\x00\x7c\x00\x7d\x00\x7e\x00\x7f\x00\xff\xff\x80\x00\x81\x00\x82\x00\x83\x00\x84\x00\x85\x00\x86\x00\x87\x00\x88\x00\x89\x00\x8a\x00\x8b\x00\x8c\x00\x8d\x00\x8e\x00\x8f\x00\x90\x00\x91\x00\x92\x00\x93\x00\x94\x00\x95\x00\x96\x00\xff\xff\x98\x00\x99\x00\x9a\x00\x9b\x00\x9c\x00\x9d\x00\x9e\x00\x9f\x00\xa0\x00\xa1\x00\xa2\x00\xa3\x00\xa4\x00\xa5\x00\xa6\x00\xa7\x00\xa8\x00\xa9\x00\xaa\x00\xab\x00\xac\x00\xad\x00\xae\x00\xaf\x00\xb0\x00\xb1\x00\xb2\x00\xb3\x00\xb4\x00\xb5\x00\xb6\x00\xff\xff\xb8\x00\xb9\x00\xba\x00\xbb\x00\xbc\x00\xbd\x00\xbe\x00\xbf\x00\xff\xff\xc2\x00\xc3\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\x2b\x00\x2c\x00\x2d\x00\x2e\x00\x2f\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x3e\x00\x3f\x00\x40\x00\x41\x00\x42\x00\x43\x00\x44\x00\x45\x00\x46\x00\x47\x00\x48\x00\x49\x00\x4a\x00\x4b\x00\x4c\x00\x4d\x00\x4e\x00\x4f\x00\x50\x00\x51\x00\x52\x00\x53\x00\x54\x00\x55\x00\x56\x00\x57\x00\x58\x00\x59\x00\x5a\x00\x5b\x00\x5c\x00\x5d\x00\x5e\x00\x5f\x00\x60\x00\x61\x00\x62\x00\x63\x00\x64\x00\x65\x00\x66\x00\x67\x00\x68\x00\x69\x00\x6a\x00\x6b\x00\x6c\x00\x6d\x00\x6e\x00\x6f\x00\x70\x00\x71\x00\x72\x00\x73\x00\x74\x00\x75\x00\x76\x00\x77\x00\x78\x00\x79\x00\x7a\x00\x7b\x00\x7c\x00\x7d\x00\x7e\x00\x7f\x00\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\xd7\x00\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\xf7\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00\x0a\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x80\x00\x81\x00\x82\x00\x83\x00\x84\x00\x85\x00\x86\x00\x87\x00\x88\x00\x89\x00\x8a\x00\x8b\x00\x8c\x00\x8d\x00\x8e\x00\x8f\x00\x90\x00\x91\x00\x92\x00\x93\x00\x94\x00\x95\x00\x96\x00\x97\x00\x98\x00\x99\x00\x9a\x00\x9b\x00\x9c\x00\x9d\x00\x9e\x00\x9f\x00\xa0\x00\xa1\x00\xa2\x00\xa3\x00\xa4\x00\xa5\x00\xa6\x00\xa7\x00\xa8\x00\xa9\x00\xaa\x00\xab\x00\xac\x00\xad\x00\xae\x00\xaf\x00\xb0\x00\xb1\x00\xb2\x00\xb3\x00\xb4\x00\xb5\x00\xb6\x00\xb7\x00\xb8\x00\xb9\x00\xba\x00\xbb\x00\xbc\x00\xbd\x00\xbe\x00\xbf\x00\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\xd7\x00\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\xf7\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00\x27\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x41\x00\x42\x00\x43\x00\x44\x00\x45\x00\x46\x00\x47\x00\x48\x00\x49\x00\x4a\x00\x4b\x00\x4c\x00\x4d\x00\x4e\x00\x4f\x00\x50\x00\x51\x00\x52\x00\x53\x00\x54\x00\x55\x00\x56\x00\x57\x00\x58\x00\x59\x00\x5a\x00\xff\xff\xff\xff\xff\xff\xff\xff\x5f\x00\xff\xff\x61\x00\x62\x00\x63\x00\x64\x00\x65\x00\x66\x00\x67\x00\x68\x00\x69\x00\x6a\x00\x6b\x00\x6c\x00\x6d\x00\x6e\x00\x6f\x00\x70\x00\x71\x00\x72\x00\x73\x00\x74\x00\x75\x00\x76\x00\x77\x00\x78\x00\x79\x00\x7a\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc3\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"#
 
 alex_deflt :: AlexAddr
-alex_deflt = AlexA# "\xff\xff\x05\x00\xff\xff\xff\xff\xff\xff\x05\x00\xff\xff\xff\xff\x05\x00\x05\x00\x12\x00\x12\x00\x03\x00\x03\x00\xff\xff\x17\x00\xff\xff\x17\x00\x1b\x00\x1b\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1c\x00\x1c\x00\x1c\x00\x1c\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"#
+alex_deflt = AlexA#
+  "\xff\xff\x05\x00\xff\xff\xff\xff\xff\xff\x05\x00\xff\xff\xff\xff\x05\x00\x05\x00\x12\x00\x12\x00\x03\x00\x03\x00\xff\xff\x17\x00\xff\xff\x17\x00\x1b\x00\x1b\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1c\x00\x1c\x00\x1c\x00\x1c\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"#
 
-alex_accept = listArray (0::Int,40) [AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccSkip,AlexAccSkip,AlexAccSkip,AlexAcc (alex_action_3),AlexAcc (alex_action_3),AlexAcc (alex_action_3),AlexAcc (alex_action_3),AlexAcc (alex_action_4),AlexAcc (alex_action_5),AlexAcc (alex_action_6),AlexAcc (alex_action_7),AlexAcc (alex_action_8),AlexAcc (alex_action_8)]
+alex_accept = listArray (0 :: Int, 40)
+  [ AlexAccNone
+  , AlexAccNone
+  , AlexAccNone
+  , AlexAccNone
+  , AlexAccNone
+  , AlexAccNone
+  , AlexAccNone
+  , AlexAccNone
+  , AlexAccNone
+  , AlexAccNone
+  , AlexAccNone
+  , AlexAccNone
+  , AlexAccNone
+  , AlexAccNone
+  , AlexAccNone
+  , AlexAccNone
+  , AlexAccNone
+  , AlexAccNone
+  , AlexAccNone
+  , AlexAccNone
+  , AlexAccNone
+  , AlexAccNone
+  , AlexAccNone
+  , AlexAccNone
+  , AlexAccNone
+  , AlexAccNone
+  , AlexAccNone
+  , AlexAccNone
+  , AlexAccSkip
+  , AlexAccSkip
+  , AlexAccSkip
+  , AlexAcc 9
+  , AlexAcc 8
+  , AlexAcc 7
+  , AlexAcc 6
+  , AlexAcc 5
+  , AlexAcc 4
+  , AlexAcc 3
+  , AlexAcc 2
+  , AlexAcc 1
+  , AlexAcc 0
+  ]
+
+alex_actions = array (0 :: Int, 10)
+  [ (9,alex_action_3)
+  , (8,alex_action_3)
+  , (7,alex_action_3)
+  , (6,alex_action_3)
+  , (5,alex_action_4)
+  , (4,alex_action_5)
+  , (3,alex_action_6)
+  , (2,alex_action_7)
+  , (1,alex_action_8)
+  , (0,alex_action_8)
+  ]
+
 {-# LINE 39 "src/LexBNF.x" #-}
 
 
@@ -66,10 +127,12 @@
  | Err Posn
   deriving (Eq,Show,Ord)
 
+printPosn :: Posn -> String
+printPosn (Pn _ l c) = "line " ++ show l ++ ", column " ++ show c
+
 tokenPos :: [Token] -> String
-tokenPos (PT (Pn _ l _) _ :_) = "line " ++ show l
-tokenPos (Err (Pn _ l _) :_) = "line " ++ show l
-tokenPos _ = "end of file"
+tokenPos (t:_) = printPosn (tokenPosn t)
+tokenPos [] = "end of file"
 
 tokenPosn :: Token -> Posn
 tokenPosn (PT p _) = p
@@ -87,12 +150,12 @@
 prToken :: Token -> String
 prToken t = case t of
   PT _ (TS s _) -> s
-  PT _ (TL s)   -> s
+  PT _ (TL s)   -> show s
   PT _ (TI s)   -> s
   PT _ (TV s)   -> s
   PT _ (TD s)   -> s
   PT _ (TC s)   -> s
-  Err _ -> "#Error"
+  Err _         -> "#error"
 
 
 data BTree = N | B String Tok BTree BTree deriving (Show)
@@ -197,11 +260,9 @@
 {-# LINE 1 "templates/GenericTemplate.hs" #-}
 {-# LINE 1 "templates/GenericTemplate.hs" #-}
 {-# LINE 1 "<built-in>" #-}
-{-# LINE 1 "<command-line>" #-}
-{-# LINE 9 "<command-line>" #-}
-# 1 "/usr/include/stdc-predef.h" 1 3 4
+{-# LINE 17 "<built-in>" #-}
+{-# LINE 1 "/usr/local/lib/ghc-8.2.1/include/ghcversion.h" #-}
 
-# 17 "/usr/include/stdc-predef.h" 3 4
 
 
 
@@ -217,6 +278,8 @@
 
 
 
+{-# LINE 18 "<built-in>" #-}
+{-# LINE 1 "/var/folders/lg/qcd3v89j59l3m6520kr42bdm0000gn/T/ghc7480_0/ghc_2.h" #-}
 
 
 
@@ -249,7 +312,618 @@
 
 
 
-{-# LINE 9 "<command-line>" #-}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{-# LINE 19 "<built-in>" #-}
 {-# LINE 1 "templates/GenericTemplate.hs" #-}
 -- -----------------------------------------------------------------------------
 -- ALEX TEMPLATE
@@ -260,6 +934,7 @@
 -- -----------------------------------------------------------------------------
 -- INTERNALS and main scanner engine
 
+
 {-# LINE 21 "templates/GenericTemplate.hs" #-}
 
 
@@ -274,6 +949,7 @@
 #define GTE(n,m) (n >=# m)
 #define EQ(n,m) (n ==# m)
 #endif
+
 {-# LINE 51 "templates/GenericTemplate.hs" #-}
 
 
@@ -301,13 +977,13 @@
 
 
 {-# INLINE alexIndexInt32OffAddr #-}
-alexIndexInt32OffAddr (AlexA# arr) off = 
+alexIndexInt32OffAddr (AlexA# arr) off =
 #ifdef WORDS_BIGENDIAN
   narrow32Int# i
   where
    i    = word2Int# ((b3 `uncheckedShiftL#` 24#) `or#`
-		     (b2 `uncheckedShiftL#` 16#) `or#`
-		     (b1 `uncheckedShiftL#` 8#) `or#` b0)
+                     (b2 `uncheckedShiftL#` 16#) `or#`
+                     (b1 `uncheckedShiftL#` 8#) `or#` b0)
    b3   = int2Word# (ord# (indexCharOffAddr# arr (off' +# 3#)))
    b2   = int2Word# (ord# (indexCharOffAddr# arr (off' +# 2#)))
    b1   = int2Word# (ord# (indexCharOffAddr# arr (off' +# 1#)))
@@ -342,49 +1018,49 @@
   | AlexToken  !AlexInput !Int a
 
 -- alexScan :: AlexInput -> StartCode -> AlexReturn a
-alexScan input (I# (sc))
-  = alexScanUser undefined input (I# (sc))
+alexScan input__ (I# (sc))
+  = alexScanUser undefined input__ (I# (sc))
 
-alexScanUser user input (I# (sc))
-  = case alex_scan_tkn user input 0# input sc AlexNone of
-	(AlexNone, input') ->
-		case alexGetByte input of
-			Nothing -> 
+alexScanUser user__ input__ (I# (sc))
+  = case alex_scan_tkn user__ input__ 0# input__ sc AlexNone of
+  (AlexNone, input__') ->
+    case alexGetByte input__ of
+      Nothing ->
 
 
 
-				   AlexEOF
-			Just _ ->
+                                   AlexEOF
+      Just _ ->
 
 
 
-				   AlexError input'
+                                   AlexError input__'
 
-	(AlexLastSkip input'' len, _) ->
+  (AlexLastSkip input__'' len, _) ->
 
 
 
-		AlexSkip input'' len
+    AlexSkip input__'' len
 
-	(AlexLastAcc k input''' len, _) ->
+  (AlexLastAcc k input__''' len, _) ->
 
 
 
-		AlexToken input''' len k
+    AlexToken input__''' len (alex_actions ! k)
 
 
 -- Push the input through the DFA, remembering the most recent accepting
 -- state it encountered.
 
-alex_scan_tkn user orig_input len input s last_acc =
-  input `seq` -- strict in the input
-  let 
-	new_acc = (check_accs (alex_accept `quickIndex` (I# (s))))
+alex_scan_tkn user__ orig_input len input__ s last_acc =
+  input__ `seq` -- strict in the input
+  let
+  new_acc = (check_accs (alex_accept `quickIndex` (I# (s))))
   in
   new_acc `seq`
-  case alexGetByte input of
-     Nothing -> (new_acc, input)
-     Just (c, new_input) -> 
+  case alexGetByte input__ of
+     Nothing -> (new_acc, input__)
+     Just (c, new_input) ->
 
 
 
@@ -393,40 +1069,33 @@
                 base   = alexIndexInt32OffAddr alex_base s
                 offset = (base +# ord_c)
                 check  = alexIndexInt16OffAddr alex_check offset
-		
+
                 new_s = if GTE(offset,0#) && EQ(check,ord_c)
-			  then alexIndexInt16OffAddr alex_table offset
-			  else alexIndexInt16OffAddr alex_deflt s
-	in
+                          then alexIndexInt16OffAddr alex_table offset
+                          else alexIndexInt16OffAddr alex_deflt s
+        in
         case new_s of
-	    -1# -> (new_acc, input)
-		-- on an error, we want to keep the input *before* the
-		-- character that failed, not after.
-    	    _ -> alex_scan_tkn user orig_input (if c < 0x80 || c >= 0xC0 then (len +# 1#) else len)
+            -1# -> (new_acc, input__)
+                -- on an error, we want to keep the input *before* the
+                -- character that failed, not after.
+            _ -> alex_scan_tkn user__ orig_input (if c < 0x80 || c >= 0xC0 then (len +# 1#) else len)
                                                 -- note that the length is increased ONLY if this is the 1st byte in a char encoding)
-			new_input new_s new_acc
+                        new_input new_s new_acc
       }
   where
-	check_accs (AlexAccNone) = last_acc
-	check_accs (AlexAcc a  ) = AlexLastAcc a input (I# (len))
-	check_accs (AlexAccSkip) = AlexLastSkip  input (I# (len))
+        check_accs (AlexAccNone) = last_acc
+        check_accs (AlexAcc a  ) = AlexLastAcc a input__ (I# (len))
+        check_accs (AlexAccSkip) = AlexLastSkip  input__ (I# (len))
+
 {-# LINE 198 "templates/GenericTemplate.hs" #-}
 
-data AlexLastAcc a
+data AlexLastAcc
   = AlexNone
-  | AlexLastAcc a !AlexInput !Int
-  | AlexLastSkip  !AlexInput !Int
-
-instance Functor AlexLastAcc where
-    fmap f AlexNone = AlexNone
-    fmap f (AlexLastAcc x y z) = AlexLastAcc (f x) y z
-    fmap f (AlexLastSkip x y) = AlexLastSkip x y
+  | AlexLastAcc !Int !AlexInput !Int
+  | AlexLastSkip     !AlexInput !Int
 
-data AlexAcc a user
+data AlexAcc user
   = AlexAccNone
-  | AlexAcc a
+  | AlexAcc Int
   | AlexAccSkip
-{-# LINE 242 "templates/GenericTemplate.hs" #-}
 
--- used by wrappers
-iUnbox (I# (i)) = i
diff --git a/dist/build/bnfc/bnfc-tmp/ParBNF.hs b/dist/build/bnfc/bnfc-tmp/ParBNF.hs
--- a/dist/build/bnfc/bnfc-tmp/ParBNF.hs
+++ b/dist/build/bnfc/bnfc-tmp/ParBNF.hs
@@ -1,1776 +1,2459 @@
 {-# OPTIONS_GHC -w #-}
-{-# OPTIONS -fglasgow-exts -cpp #-}
-{-# OPTIONS_GHC -fno-warn-incomplete-patterns -fno-warn-overlapping-patterns #-}
-module ParBNF where
-import AbsBNF
-import LexBNF
-import ErrM
-import qualified Data.Array as Happy_Data_Array
-import qualified GHC.Exts as Happy_GHC_Exts
-import Control.Applicative(Applicative(..))
-import Control.Monad (ap)
-
--- parser produced by Happy Version 1.19.5
-
-newtype HappyAbsSyn  = HappyAbsSyn HappyAny
-#if __GLASGOW_HASKELL__ >= 607
-type HappyAny = Happy_GHC_Exts.Any
-#else
-type HappyAny = forall a . a
-#endif
-happyIn36 :: (String) -> (HappyAbsSyn )
-happyIn36 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn36 #-}
-happyOut36 :: (HappyAbsSyn ) -> (String)
-happyOut36 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut36 #-}
-happyIn37 :: (Ident) -> (HappyAbsSyn )
-happyIn37 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn37 #-}
-happyOut37 :: (HappyAbsSyn ) -> (Ident)
-happyOut37 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut37 #-}
-happyIn38 :: (Integer) -> (HappyAbsSyn )
-happyIn38 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn38 #-}
-happyOut38 :: (HappyAbsSyn ) -> (Integer)
-happyOut38 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut38 #-}
-happyIn39 :: (Char) -> (HappyAbsSyn )
-happyIn39 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn39 #-}
-happyOut39 :: (HappyAbsSyn ) -> (Char)
-happyOut39 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut39 #-}
-happyIn40 :: (Double) -> (HappyAbsSyn )
-happyIn40 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn40 #-}
-happyOut40 :: (HappyAbsSyn ) -> (Double)
-happyOut40 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut40 #-}
-happyIn41 :: (LGrammar) -> (HappyAbsSyn )
-happyIn41 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn41 #-}
-happyOut41 :: (HappyAbsSyn ) -> (LGrammar)
-happyOut41 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut41 #-}
-happyIn42 :: (LDef) -> (HappyAbsSyn )
-happyIn42 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn42 #-}
-happyOut42 :: (HappyAbsSyn ) -> (LDef)
-happyOut42 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut42 #-}
-happyIn43 :: ([LDef]) -> (HappyAbsSyn )
-happyIn43 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn43 #-}
-happyOut43 :: (HappyAbsSyn ) -> ([LDef])
-happyOut43 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut43 #-}
-happyIn44 :: (Grammar) -> (HappyAbsSyn )
-happyIn44 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn44 #-}
-happyOut44 :: (HappyAbsSyn ) -> (Grammar)
-happyOut44 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut44 #-}
-happyIn45 :: ([Def]) -> (HappyAbsSyn )
-happyIn45 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn45 #-}
-happyOut45 :: (HappyAbsSyn ) -> ([Def])
-happyOut45 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut45 #-}
-happyIn46 :: ([Item]) -> (HappyAbsSyn )
-happyIn46 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn46 #-}
-happyOut46 :: (HappyAbsSyn ) -> ([Item])
-happyOut46 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut46 #-}
-happyIn47 :: (Def) -> (HappyAbsSyn )
-happyIn47 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn47 #-}
-happyOut47 :: (HappyAbsSyn ) -> (Def)
-happyOut47 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut47 #-}
-happyIn48 :: (Item) -> (HappyAbsSyn )
-happyIn48 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn48 #-}
-happyOut48 :: (HappyAbsSyn ) -> (Item)
-happyOut48 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut48 #-}
-happyIn49 :: (Cat) -> (HappyAbsSyn )
-happyIn49 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn49 #-}
-happyOut49 :: (HappyAbsSyn ) -> (Cat)
-happyOut49 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut49 #-}
-happyIn50 :: (Label) -> (HappyAbsSyn )
-happyIn50 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn50 #-}
-happyOut50 :: (HappyAbsSyn ) -> (Label)
-happyOut50 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut50 #-}
-happyIn51 :: (LabelId) -> (HappyAbsSyn )
-happyIn51 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn51 #-}
-happyOut51 :: (HappyAbsSyn ) -> (LabelId)
-happyOut51 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut51 #-}
-happyIn52 :: (ProfItem) -> (HappyAbsSyn )
-happyIn52 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn52 #-}
-happyOut52 :: (HappyAbsSyn ) -> (ProfItem)
-happyOut52 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut52 #-}
-happyIn53 :: (IntList) -> (HappyAbsSyn )
-happyIn53 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn53 #-}
-happyOut53 :: (HappyAbsSyn ) -> (IntList)
-happyOut53 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut53 #-}
-happyIn54 :: ([Integer]) -> (HappyAbsSyn )
-happyIn54 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn54 #-}
-happyOut54 :: (HappyAbsSyn ) -> ([Integer])
-happyOut54 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut54 #-}
-happyIn55 :: ([IntList]) -> (HappyAbsSyn )
-happyIn55 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn55 #-}
-happyOut55 :: (HappyAbsSyn ) -> ([IntList])
-happyOut55 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut55 #-}
-happyIn56 :: ([ProfItem]) -> (HappyAbsSyn )
-happyIn56 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn56 #-}
-happyOut56 :: (HappyAbsSyn ) -> ([ProfItem])
-happyOut56 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut56 #-}
-happyIn57 :: (Separation) -> (HappyAbsSyn )
-happyIn57 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn57 #-}
-happyOut57 :: (HappyAbsSyn ) -> (Separation)
-happyOut57 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut57 #-}
-happyIn58 :: (Arg) -> (HappyAbsSyn )
-happyIn58 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn58 #-}
-happyOut58 :: (HappyAbsSyn ) -> (Arg)
-happyOut58 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut58 #-}
-happyIn59 :: ([Arg]) -> (HappyAbsSyn )
-happyIn59 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn59 #-}
-happyOut59 :: (HappyAbsSyn ) -> ([Arg])
-happyOut59 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut59 #-}
-happyIn60 :: (Exp) -> (HappyAbsSyn )
-happyIn60 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn60 #-}
-happyOut60 :: (HappyAbsSyn ) -> (Exp)
-happyOut60 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut60 #-}
-happyIn61 :: (Exp) -> (HappyAbsSyn )
-happyIn61 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn61 #-}
-happyOut61 :: (HappyAbsSyn ) -> (Exp)
-happyOut61 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut61 #-}
-happyIn62 :: (Exp) -> (HappyAbsSyn )
-happyIn62 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn62 #-}
-happyOut62 :: (HappyAbsSyn ) -> (Exp)
-happyOut62 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut62 #-}
-happyIn63 :: ([Exp]) -> (HappyAbsSyn )
-happyIn63 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn63 #-}
-happyOut63 :: (HappyAbsSyn ) -> ([Exp])
-happyOut63 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut63 #-}
-happyIn64 :: ([Exp]) -> (HappyAbsSyn )
-happyIn64 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn64 #-}
-happyOut64 :: (HappyAbsSyn ) -> ([Exp])
-happyOut64 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut64 #-}
-happyIn65 :: ([String]) -> (HappyAbsSyn )
-happyIn65 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn65 #-}
-happyOut65 :: (HappyAbsSyn ) -> ([String])
-happyOut65 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut65 #-}
-happyIn66 :: ([RHS]) -> (HappyAbsSyn )
-happyIn66 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn66 #-}
-happyOut66 :: (HappyAbsSyn ) -> ([RHS])
-happyOut66 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut66 #-}
-happyIn67 :: (RHS) -> (HappyAbsSyn )
-happyIn67 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn67 #-}
-happyOut67 :: (HappyAbsSyn ) -> (RHS)
-happyOut67 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut67 #-}
-happyIn68 :: (MinimumSize) -> (HappyAbsSyn )
-happyIn68 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn68 #-}
-happyOut68 :: (HappyAbsSyn ) -> (MinimumSize)
-happyOut68 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut68 #-}
-happyIn69 :: (Reg) -> (HappyAbsSyn )
-happyIn69 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn69 #-}
-happyOut69 :: (HappyAbsSyn ) -> (Reg)
-happyOut69 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut69 #-}
-happyIn70 :: (Reg) -> (HappyAbsSyn )
-happyIn70 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn70 #-}
-happyOut70 :: (HappyAbsSyn ) -> (Reg)
-happyOut70 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut70 #-}
-happyIn71 :: (Reg) -> (HappyAbsSyn )
-happyIn71 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn71 #-}
-happyOut71 :: (HappyAbsSyn ) -> (Reg)
-happyOut71 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut71 #-}
-happyIn72 :: (Reg) -> (HappyAbsSyn )
-happyIn72 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn72 #-}
-happyOut72 :: (HappyAbsSyn ) -> (Reg)
-happyOut72 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut72 #-}
-happyIn73 :: ([Ident]) -> (HappyAbsSyn )
-happyIn73 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn73 #-}
-happyOut73 :: (HappyAbsSyn ) -> ([Ident])
-happyOut73 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut73 #-}
-happyInTok :: (Token) -> (HappyAbsSyn )
-happyInTok x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyInTok #-}
-happyOutTok :: (HappyAbsSyn ) -> (Token)
-happyOutTok x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOutTok #-}
-
-
-happyActOffsets :: HappyAddr
-happyActOffsets = HappyA# "\x45\x00\x45\x00\x45\x00\x64\x00\x64\x00\x00\x00\x64\x00\xbc\x00\xbd\x00\x71\x00\x71\x00\xda\x01\xd9\x01\xd8\x01\xd6\x01\xd7\x01\x7e\x01\xd5\x01\x00\x00\x07\x00\x07\x00\x07\x00\x07\x00\x07\x00\xd4\x01\x00\x00\x00\x00\xd3\x01\x29\x00\x29\x00\x29\x00\x29\x00\xd2\x01\xcc\x01\x00\x00\xd1\x01\xcb\x01\x00\x00\x00\x00\x11\x00\xd0\x01\x89\x01\xc8\x01\x29\x00\xc9\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc9\x01\x00\x00\x3e\x00\xe2\xff\x01\x00\xc5\x01\x00\x00\xbc\x00\xc5\x01\xc5\x01\xc4\x01\xcf\x01\xc3\x01\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\xce\x01\xca\x01\x00\x00\xc2\x01\x07\x00\x07\x00\x00\x00\x00\x00\x00\x00\x07\x00\xc2\x01\xc2\x01\xc2\x01\xc2\x01\x6a\x01\x00\x00\xc2\x01\xc2\x01\xc1\x01\xc1\x01\xcd\x01\xbf\x01\xc0\x01\xc7\x01\xbe\x01\xbc\x01\xc6\x01\xba\x01\xba\x01\xba\x01\x00\x00\xba\x01\xbd\x01\xb9\x01\x00\x00\xb4\x01\x5e\x00\x00\x00\xb4\x01\xbd\x00\x00\x00\xb4\x01\x00\x00\xb4\x01\xbb\x01\xb6\x01\xb5\x01\xb3\x01\xbd\x00\xb3\x01\x44\x00\x68\x01\xaf\x01\xad\x01\xa8\x01\xa8\x01\xa6\x01\x7c\x00\x9c\x01\xb7\x01\x9b\x01\x00\x00\x8b\x00\xb0\x01\x9a\x01\x00\x00\xb8\x01\x99\x01\x98\x01\x98\x01\x00\x00\x00\x00\x64\x00\x45\x00\x93\x01\x64\x00\x00\x00\x29\x00\xbd\x00\xbd\x00\xb2\x01\x8e\x01\x00\x00\x96\x01\x00\x00\xae\x01\x00\x00\x95\x01\x00\x00\x95\x01\x91\x01\xbd\x00\xab\x01\xb1\x01\x00\x00\xfe\xff\x00\x00\x6e\x00\x84\x01\xa9\x01\xa7\x01\xa7\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa5\x01\xac\x01\x07\x00\x07\x00\x00\x00\x8d\x01\x00\x00\x10\x01\x29\x00\x00\x00\x00\x00\x00\x00\x85\x01\xa3\x01\xaa\x01\x29\x00\x29\x00\x00\x00\x00\x00\x00\x00\x29\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa2\x01\x00\x00\x00\x00\x00\x00\x00\x00\x9d\x01\x00\x00\x00\x00\xa1\x01\x00\x00\x00\x00\xf6\xff\x80\x01\xbd\x00\x00\x00\x29\x00\x00\x00\x80\x01\x80\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x9e\x01\x7e\x01\x07\x00\x00\x00\xa4\x01\xa0\x01\x97\x01\x00\x00\xbc\x00\x00\x00\x8c\x01\x00\x00\xbc\x00\x00\x00\x78\x01\x94\x01\x9f\x01\x00\x00\x00\x00"#
-
-happyGotoOffsets :: HappyAddr
-happyGotoOffsets = HappyA# "\x86\x00\xa3\x00\xa1\x00\x58\x01\x6e\x01\x90\x01\x70\x01\x82\x01\x86\x01\x77\x01\x06\x00\x87\x01\x8f\x01\xb2\x00\x8b\x01\x48\x01\x74\x01\x0c\x00\x7f\x01\x30\x01\x4b\x01\x50\x01\x05\x01\xf6\x00\xc7\x00\x3c\x01\x31\x00\x3e\x01\xc0\x00\xb0\x00\x46\x00\xaa\x00\x23\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1c\x00\x00\x00\x00\x00\x00\x00\x9e\x00\x92\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x8a\x01\x00\x00\x00\x00\x00\x00\x1c\x00\x00\x00\x00\x00\xde\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2b\x01\xd9\x00\x00\x00\x00\x00\x00\x00\xfb\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x7a\x01\x6b\x01\x28\x01\x00\x00\x00\x00\x00\x00\x00\x00\x88\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x09\x01\x00\x00\x00\x00\x83\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x73\x01\x5d\x01\x56\x01\x61\x01\x22\x00\x72\x01\xc5\x00\x00\x00\x46\x01\x1d\x01\xfe\x00\x0b\x01\xde\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x09\x00\x00\x00\x00\x00\x00\x00\x00\x00\x5e\x01\x91\x00\x04\x00\x67\x01\x00\x00\x9a\x00\x35\x01\x0a\x01\x00\x00\xee\x00\x00\x00\x79\x00\x00\x00\x00\x00\x00\x00\xe9\x00\xfc\xff\xe0\x00\xce\x00\xe7\x00\x00\x00\xfd\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7d\x00\x00\x00\x88\x01\x24\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x26\x01\xd4\x00\x00\x00\x4b\x00\x37\x01\x00\x00\x39\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x17\x00\x1c\x00\x00\x00\x00\x00\x00\x00\x1c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\xcf\x00\x02\x00\x00\x00\x96\x00\x42\x00\xb5\x00\x4e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x8e\x00\x21\x01\x94\x00\x00\x00\x00\x00\x00\x00\x00\x00\xde\x00\x00\x00\xec\xff\x13\x00\xde\x00\x00\x00\x72\x00\x00\x00\x00\x00\x00\x00\x00\x00"#
-
-happyDefActions :: HappyAddr
-happyDefActions = HappyA# "\xd5\xff\x00\x00\xd5\xff\xd1\xff\xd1\xff\xce\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xad\xff\xaa\xff\x00\x00\xa5\xff\x00\x00\xa1\xff\x00\x00\x00\x00\x00\x00\x00\x00\x92\xff\x00\x00\xce\xff\xce\xff\x89\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xde\xff\x75\xff\x00\x00\xdd\xff\x7f\xff\x84\xff\x76\xff\x87\xff\x00\x00\x00\x00\x00\x00\x78\xff\x7c\xff\x80\xff\x7b\xff\x79\xff\x7a\xff\x00\x00\xdb\xff\x00\x00\x00\x00\x00\x00\x00\x00\x8a\xff\x8b\xff\x00\x00\x00\x00\x8d\xff\x8f\xff\x00\x00\x98\xff\x9b\xff\x9a\xff\x99\xff\x97\xff\x91\xff\x9e\xff\x9c\xff\x00\x00\x00\x00\x92\xff\xdc\xff\xda\xff\x9b\xff\x94\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa2\xff\x00\x00\x00\x00\x00\x00\x00\x00\xa7\xff\x00\x00\x00\x00\xa9\xff\x00\x00\xad\xff\xac\xff\x00\x00\x00\x00\x00\x00\xb4\xff\x00\x00\x00\x00\x00\x00\xb3\xff\x00\x00\xb8\xff\xb9\xff\x00\x00\x00\x00\xbc\xff\x00\x00\xbb\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x89\xff\x89\xff\x00\x00\x00\x00\x00\x00\xd0\xff\x00\x00\xd2\xff\xb4\xff\xd4\xff\x00\x00\xd8\xff\x00\x00\x00\x00\x00\x00\x00\x00\xd9\xff\xd6\xff\x00\x00\xd5\xff\x00\x00\xd1\xff\xcd\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xbf\xff\x00\x00\xbd\xff\x00\x00\xc6\xff\x00\x00\xa1\xff\xcb\xff\x00\x00\x00\x00\x00\x00\xb5\xff\xb7\xff\x00\x00\xb2\xff\x00\x00\xad\xff\x00\x00\xaa\xff\xaa\xff\xa6\xff\xa4\xff\xa3\xff\xa0\xff\x93\xff\x00\x00\x00\x00\x00\x00\x92\xff\x9d\xff\x00\x00\xce\xff\x88\xff\x00\x00\x83\xff\x82\xff\x81\xff\x00\x00\x00\x00\x00\x00\x00\x00\x85\xff\x77\xff\x7e\xff\x7d\xff\x86\xff\x8c\xff\x8e\xff\x90\xff\x9f\xff\x95\xff\x96\xff\x00\x00\xa8\xff\xae\xff\xab\xff\xb1\xff\x00\x00\xb6\xff\xba\xff\x00\x00\xc2\xff\xca\xff\x00\x00\x00\x00\x00\x00\xbe\xff\x00\x00\xce\xff\x00\x00\x00\x00\xc8\xff\xcf\xff\x74\xff\xd3\xff\xd7\xff\xc4\xff\xc5\xff\xc1\xff\xc7\xff\x00\x00\xa5\xff\x00\x00\xce\xff\x00\x00\x00\x00\x00\x00\xb0\xff\xcc\xff\xc0\xff\x89\xff\xce\xff\xc9\xff\xc3\xff\xad\xff\x00\x00\x00\x00\xaf\xff"#
-
-happyCheck :: HappyAddr
-happyCheck = HappyA# "\xff\xff\x0b\x00\x01\x00\x01\x00\x01\x00\x01\x00\x08\x00\x01\x00\x01\x00\x27\x00\x01\x00\x0d\x00\x20\x00\x01\x00\x0d\x00\x0d\x00\x2e\x00\x10\x00\x01\x00\x17\x00\x0d\x00\x0f\x00\x15\x00\x06\x00\x17\x00\x16\x00\x03\x00\x1a\x00\x1b\x00\x0a\x00\x0d\x00\x03\x00\x2a\x00\x10\x00\x16\x00\x01\x00\x01\x00\x24\x00\x15\x00\x26\x00\x17\x00\x25\x00\x01\x00\x1a\x00\x1b\x00\x2c\x00\x25\x00\x2e\x00\x29\x00\x2a\x00\x2b\x00\x2c\x00\x2d\x00\x24\x00\x0d\x00\x26\x00\x21\x00\x10\x00\x23\x00\x0a\x00\x03\x00\x2c\x00\x15\x00\x23\x00\x17\x00\x03\x00\x04\x00\x1a\x00\x1b\x00\x01\x00\x01\x00\x25\x00\x25\x00\x03\x00\x0c\x00\x00\x00\x0a\x00\x24\x00\x00\x00\x26\x00\x1f\x00\x0d\x00\x0d\x00\x0f\x00\x0f\x00\x2c\x00\x11\x00\x12\x00\x13\x00\x14\x00\x21\x00\x16\x00\x23\x00\x18\x00\x19\x00\x01\x00\x1e\x00\x1f\x00\x1d\x00\x1e\x00\x1f\x00\x01\x00\x21\x00\x22\x00\x1d\x00\x23\x00\x25\x00\x0d\x00\x2e\x00\x0f\x00\x2a\x00\x2a\x00\x02\x00\x0d\x00\x01\x00\x0f\x00\x02\x00\x11\x00\x12\x00\x13\x00\x14\x00\x00\x00\x16\x00\x0d\x00\x18\x00\x19\x00\x0d\x00\x02\x00\x0f\x00\x1d\x00\x1e\x00\x1f\x00\x12\x00\x21\x00\x22\x00\x01\x00\x2a\x00\x0d\x00\x02\x00\x05\x00\x06\x00\x07\x00\x2a\x00\x12\x00\x05\x00\x0b\x00\x01\x00\x08\x00\x0e\x00\x0f\x00\x1d\x00\x06\x00\x07\x00\x03\x00\x12\x00\x2a\x00\x0b\x00\x03\x00\x0a\x00\x0e\x00\x0f\x00\x03\x00\x01\x00\x15\x00\x01\x00\x29\x00\x2a\x00\x06\x00\x07\x00\x06\x00\x2e\x00\x25\x00\x0b\x00\x03\x00\x0b\x00\x0e\x00\x0f\x00\x0e\x00\x0f\x00\x03\x00\x02\x00\x00\x00\x25\x00\x21\x00\x22\x00\x23\x00\x24\x00\x21\x00\x22\x00\x23\x00\x24\x00\x21\x00\x22\x00\x23\x00\x24\x00\x03\x00\x12\x00\x00\x00\x25\x00\x00\x00\x25\x00\x0d\x00\x0d\x00\x21\x00\x22\x00\x23\x00\x24\x00\x00\x00\x02\x00\x21\x00\x22\x00\x23\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x00\x00\x01\x00\x00\x00\x21\x00\x1d\x00\x23\x00\x1d\x00\x29\x00\x2a\x00\x2a\x00\x01\x00\x00\x00\x0c\x00\x0d\x00\x18\x00\x19\x00\x1a\x00\x01\x00\x1c\x00\x18\x00\x19\x00\x1a\x00\x0d\x00\x1c\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x01\x00\x01\x00\x01\x00\x10\x00\x18\x00\x19\x00\x1a\x00\x14\x00\x1c\x00\x03\x00\x04\x00\x1a\x00\x1b\x00\x0d\x00\x0f\x00\x10\x00\x1a\x00\x1b\x00\x0c\x00\x14\x00\x20\x00\x1a\x00\x1b\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x11\x00\x01\x00\x13\x00\x10\x00\x18\x00\x19\x00\x1a\x00\x14\x00\x20\x00\x18\x00\x19\x00\x1a\x00\x0a\x00\x0d\x00\x18\x00\x19\x00\x1a\x00\x0a\x00\x01\x00\x18\x00\x19\x00\x1a\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x1e\x00\x1f\x00\x01\x00\x10\x00\x01\x00\x1e\x00\x1f\x00\x14\x00\x00\x00\x20\x00\x01\x00\x08\x00\x09\x00\x01\x00\x0b\x00\x19\x00\x1a\x00\x0e\x00\x0f\x00\x01\x00\x0b\x00\x1a\x00\x00\x00\x0e\x00\x0f\x00\x0d\x00\x01\x00\x09\x00\x01\x00\x0b\x00\x01\x00\x01\x00\x0e\x00\x0f\x00\x09\x00\x01\x00\x0b\x00\x00\x00\x0b\x00\x0e\x00\x0f\x00\x0e\x00\x0f\x00\x0e\x00\x0f\x00\x00\x00\x01\x00\x01\x00\x0e\x00\x0f\x00\x01\x00\x20\x00\x15\x00\x00\x00\x23\x00\x03\x00\x04\x00\x0c\x00\x0d\x00\x0d\x00\x29\x00\x00\x00\x0d\x00\x2a\x00\x0c\x00\x17\x00\x10\x00\x2e\x00\x11\x00\x0a\x00\x13\x00\x11\x00\x1f\x00\x13\x00\x21\x00\x11\x00\x02\x00\x0e\x00\x2b\x00\x0d\x00\x05\x00\x02\x00\x09\x00\x1c\x00\x29\x00\x09\x00\x0e\x00\x02\x00\x28\x00\x02\x00\x2b\x00\x0e\x00\x0e\x00\x01\x00\x0e\x00\x0d\x00\x07\x00\x29\x00\x0e\x00\x2a\x00\x0e\x00\x0a\x00\x09\x00\x2b\x00\x2a\x00\x29\x00\x29\x00\x08\x00\x0a\x00\x07\x00\x2a\x00\x1c\x00\x08\x00\x2e\x00\x0e\x00\x2e\x00\x2e\x00\x2e\x00\x05\x00\x05\x00\x0d\x00\x01\x00\xff\xff\x2a\x00\x22\x00\x08\x00\x05\x00\x05\x00\xff\xff\x05\x00\x2a\x00\x01\x00\xff\xff\xff\xff\x01\x00\xff\xff\x2a\x00\x29\x00\xff\xff\x2a\x00\xff\xff\x2e\x00\x0d\x00\xff\xff\xff\xff\x0d\x00\x2b\x00\x2e\x00\xff\xff\x29\x00\x27\x00\x2e\x00\x2e\x00\xff\xff\x1c\x00\x2e\x00\x2e\x00\x29\x00\x2e\x00\xff\xff\x29\x00\x2e\x00\x27\x00\xff\xff\x2e\x00\xff\xff\xff\xff\x2a\x00\x29\x00\xff\xff\x2a\x00\xff\xff\xff\xff\xff\xff\x2b\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"#
-
-happyTable :: HappyAddr
-happyTable = HappyA# "\x00\x00\xea\x00\x2c\x00\x6a\x00\x54\x00\x23\x00\xa7\x00\x63\x00\x4a\x00\xb9\x00\x23\x00\xab\x00\xf4\x00\x54\x00\x2d\x00\xe7\x00\xff\xff\x2e\x00\x2c\x00\xd6\x00\x4b\x00\x64\x00\x2f\x00\xc0\x00\x30\x00\xae\x00\x26\x00\x31\x00\x32\x00\xf3\x00\x2d\x00\x26\x00\x26\x00\x2e\x00\x55\x00\x23\x00\x23\x00\x33\x00\x2f\x00\x34\x00\x30\x00\xe0\x00\x2c\x00\x31\x00\x32\x00\x35\x00\x8c\x00\xff\xff\x23\x00\x26\x00\x4c\x00\x35\x00\x4d\x00\x33\x00\x2d\x00\x34\x00\xc0\x00\x2e\x00\x29\x00\x3a\x00\x26\x00\x35\x00\x2f\x00\xb7\x00\x30\x00\xba\x00\xbb\x00\x31\x00\x32\x00\x66\x00\x66\x00\x9b\x00\x24\x00\x26\x00\xbc\x00\x3e\x00\x3a\x00\x33\x00\xe3\x00\x34\x00\x3b\x00\x67\x00\x67\x00\x68\x00\x68\x00\x35\x00\x73\x00\x74\x00\x75\x00\x76\x00\xc4\x00\x77\x00\x29\x00\x78\x00\x79\x00\xa5\x00\xe5\x00\x3d\x00\x7a\x00\x7b\x00\x7c\x00\x66\x00\x7d\x00\x7e\x00\xc6\x00\x35\x00\x89\x00\x67\x00\xff\xff\x68\x00\x26\x00\x26\x00\xd0\x00\x67\x00\x66\x00\x68\x00\x5f\x00\x73\x00\x74\x00\x75\x00\x76\x00\x3e\x00\x77\x00\xd1\x00\x78\x00\x79\x00\x67\x00\x5f\x00\x68\x00\x7a\x00\x7b\x00\x7c\x00\xf6\x00\x7d\x00\x7e\x00\x83\x00\x26\x00\x6d\x00\x5f\x00\x8a\x00\x84\x00\x8b\x00\x26\x00\xce\x00\x90\x00\x86\x00\x83\x00\x75\xff\x71\x00\x69\x00\xd9\x00\x84\x00\xe1\x00\x26\x00\xa8\x00\x26\x00\x86\x00\x26\x00\xef\x00\x71\x00\x69\x00\x26\x00\x83\x00\xf1\x00\x83\x00\x23\x00\x26\x00\x84\x00\x85\x00\x89\x00\xff\xff\x87\x00\x86\x00\x26\x00\x86\x00\x71\x00\x69\x00\x71\x00\x69\x00\x26\x00\x5f\x00\xe4\x00\x87\x00\x27\x00\x28\x00\x29\x00\xe6\x00\x27\x00\x28\x00\x29\x00\xde\x00\x27\x00\x28\x00\x29\x00\xbe\x00\x26\x00\x60\x00\x3e\x00\x87\x00\x3e\x00\x87\x00\x6d\x00\x6d\x00\x27\x00\x28\x00\x29\x00\x2a\x00\xe8\x00\xd4\x00\x27\x00\x36\x00\x29\x00\x40\x00\x41\x00\x42\x00\x43\x00\x44\x00\x40\x00\x41\x00\x42\x00\x43\x00\x44\x00\x6d\x00\x6a\x00\xd5\x00\x37\x00\x97\x00\x29\x00\x3f\x00\x23\x00\x26\x00\x26\x00\x6a\x00\xd7\x00\x91\x00\x6f\x00\x45\x00\x46\x00\x47\x00\xda\x00\xc7\x00\x45\x00\x46\x00\x47\x00\xd3\x00\xb0\x00\x40\x00\x41\x00\x42\x00\x43\x00\x44\x00\x40\x00\x4d\x00\x42\x00\x43\x00\x44\x00\x40\x00\x4d\x00\x42\x00\x43\x00\x44\x00\x40\x00\x4d\x00\x42\x00\x43\x00\x44\x00\x63\x00\x6a\x00\x92\x00\x59\x00\x45\x00\x46\x00\x47\x00\xd1\x00\x48\x00\xba\x00\xbb\x00\x4e\x00\xaf\x00\xdc\x00\xa2\x00\x59\x00\x4e\x00\xb4\x00\xbc\x00\xa3\x00\x93\x00\x4e\x00\x4f\x00\x40\x00\x41\x00\x42\x00\x43\x00\x44\x00\x40\x00\x41\x00\x42\x00\x43\x00\x44\x00\x40\x00\x41\x00\x42\x00\x43\x00\x44\x00\x40\x00\x41\x00\x42\x00\x43\x00\x44\x00\x5c\x00\x6a\x00\xcb\x00\x59\x00\xf0\x00\x46\x00\x47\x00\xab\x00\x94\x00\xc8\x00\x46\x00\x47\x00\x3a\x00\xdd\x00\xb1\x00\x46\x00\x47\x00\x3a\x00\x95\x00\x52\x00\x46\x00\x47\x00\x40\x00\x41\x00\x42\x00\x43\x00\x44\x00\x40\x00\x4d\x00\x42\x00\x43\x00\x44\x00\xc5\x00\x3d\x00\x9d\x00\x59\x00\x63\x00\x3c\x00\x3d\x00\x5a\x00\x9e\x00\x38\x00\x63\x00\x81\x00\x82\x00\x6a\x00\x80\x00\x51\x00\x47\x00\x71\x00\x69\x00\x63\x00\xe2\x00\x50\x00\xac\x00\x71\x00\x69\x00\x9c\x00\x63\x00\xdf\x00\x63\x00\x80\x00\x63\x00\x9f\x00\x71\x00\x69\x00\x7f\x00\x63\x00\x80\x00\xad\x00\x70\x00\x71\x00\x69\x00\x71\x00\x69\x00\x9a\x00\x69\x00\x6d\x00\x6a\x00\x6a\x00\x68\x00\x69\x00\x6a\x00\x99\x00\x56\x00\xbc\x00\x9a\x00\xba\x00\xbb\x00\x6e\x00\x6f\x00\xa1\x00\x23\x00\xbd\x00\x6b\x00\x26\x00\xbc\x00\x53\x00\x62\x00\xff\xff\x5c\x00\x7e\x00\xcc\x00\x5c\x00\x58\x00\x5d\x00\x59\x00\x61\x00\xf9\x00\xf8\x00\x4c\x00\xf6\x00\xee\x00\xef\x00\xf3\x00\x3a\x00\x23\x00\xeb\x00\xec\x00\xc2\x00\xc4\x00\xca\x00\x4c\x00\xed\x00\xc3\x00\x5c\x00\xcb\x00\x5f\x00\xd9\x00\x23\x00\xce\x00\x26\x00\xd3\x00\x8f\x00\xdc\x00\x4c\x00\x26\x00\x23\x00\x23\x00\x8e\x00\x91\x00\xa1\x00\x26\x00\x3a\x00\xa7\x00\xff\xff\xa6\x00\xff\xff\xff\xff\xff\xff\xa8\x00\xaa\x00\xab\x00\x5c\x00\x00\x00\x26\x00\x97\x00\xb3\x00\xb4\x00\xb6\x00\x00\x00\x90\x00\x26\x00\x5c\x00\x00\x00\x00\x00\x5c\x00\x00\x00\x26\x00\x23\x00\x00\x00\x26\x00\x00\x00\xff\xff\x5f\x00\x00\x00\x00\x00\x5f\x00\x4c\x00\xff\xff\x00\x00\x23\x00\xb7\x00\xff\xff\xff\xff\x00\x00\x3a\x00\xff\xff\xff\xff\x23\x00\xff\xff\x00\x00\x23\x00\xff\xff\xb9\x00\x00\x00\xff\xff\x00\x00\x00\x00\x26\x00\x23\x00\x00\x00\x26\x00\x00\x00\x00\x00\x00\x00\x4c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"#
-
-happyReduceArr = Happy_Data_Array.array (33, 139) [
-	(33 , happyReduce_33),
-	(34 , happyReduce_34),
-	(35 , happyReduce_35),
-	(36 , happyReduce_36),
-	(37 , happyReduce_37),
-	(38 , happyReduce_38),
-	(39 , happyReduce_39),
-	(40 , happyReduce_40),
-	(41 , happyReduce_41),
-	(42 , happyReduce_42),
-	(43 , happyReduce_43),
-	(44 , happyReduce_44),
-	(45 , happyReduce_45),
-	(46 , happyReduce_46),
-	(47 , happyReduce_47),
-	(48 , happyReduce_48),
-	(49 , happyReduce_49),
-	(50 , happyReduce_50),
-	(51 , happyReduce_51),
-	(52 , happyReduce_52),
-	(53 , happyReduce_53),
-	(54 , happyReduce_54),
-	(55 , happyReduce_55),
-	(56 , happyReduce_56),
-	(57 , happyReduce_57),
-	(58 , happyReduce_58),
-	(59 , happyReduce_59),
-	(60 , happyReduce_60),
-	(61 , happyReduce_61),
-	(62 , happyReduce_62),
-	(63 , happyReduce_63),
-	(64 , happyReduce_64),
-	(65 , happyReduce_65),
-	(66 , happyReduce_66),
-	(67 , happyReduce_67),
-	(68 , happyReduce_68),
-	(69 , happyReduce_69),
-	(70 , happyReduce_70),
-	(71 , happyReduce_71),
-	(72 , happyReduce_72),
-	(73 , happyReduce_73),
-	(74 , happyReduce_74),
-	(75 , happyReduce_75),
-	(76 , happyReduce_76),
-	(77 , happyReduce_77),
-	(78 , happyReduce_78),
-	(79 , happyReduce_79),
-	(80 , happyReduce_80),
-	(81 , happyReduce_81),
-	(82 , happyReduce_82),
-	(83 , happyReduce_83),
-	(84 , happyReduce_84),
-	(85 , happyReduce_85),
-	(86 , happyReduce_86),
-	(87 , happyReduce_87),
-	(88 , happyReduce_88),
-	(89 , happyReduce_89),
-	(90 , happyReduce_90),
-	(91 , happyReduce_91),
-	(92 , happyReduce_92),
-	(93 , happyReduce_93),
-	(94 , happyReduce_94),
-	(95 , happyReduce_95),
-	(96 , happyReduce_96),
-	(97 , happyReduce_97),
-	(98 , happyReduce_98),
-	(99 , happyReduce_99),
-	(100 , happyReduce_100),
-	(101 , happyReduce_101),
-	(102 , happyReduce_102),
-	(103 , happyReduce_103),
-	(104 , happyReduce_104),
-	(105 , happyReduce_105),
-	(106 , happyReduce_106),
-	(107 , happyReduce_107),
-	(108 , happyReduce_108),
-	(109 , happyReduce_109),
-	(110 , happyReduce_110),
-	(111 , happyReduce_111),
-	(112 , happyReduce_112),
-	(113 , happyReduce_113),
-	(114 , happyReduce_114),
-	(115 , happyReduce_115),
-	(116 , happyReduce_116),
-	(117 , happyReduce_117),
-	(118 , happyReduce_118),
-	(119 , happyReduce_119),
-	(120 , happyReduce_120),
-	(121 , happyReduce_121),
-	(122 , happyReduce_122),
-	(123 , happyReduce_123),
-	(124 , happyReduce_124),
-	(125 , happyReduce_125),
-	(126 , happyReduce_126),
-	(127 , happyReduce_127),
-	(128 , happyReduce_128),
-	(129 , happyReduce_129),
-	(130 , happyReduce_130),
-	(131 , happyReduce_131),
-	(132 , happyReduce_132),
-	(133 , happyReduce_133),
-	(134 , happyReduce_134),
-	(135 , happyReduce_135),
-	(136 , happyReduce_136),
-	(137 , happyReduce_137),
-	(138 , happyReduce_138),
-	(139 , happyReduce_139)
-	]
-
-happy_n_terms = 47 :: Int
-happy_n_nonterms = 38 :: Int
-
-happyReduce_33 = happySpecReduce_1  0# happyReduction_33
-happyReduction_33 happy_x_1
-	 =  case happyOutTok happy_x_1 of { (PT _ (TL happy_var_1)) -> 
-	happyIn36
-		 (happy_var_1
-	)}
-
-happyReduce_34 = happySpecReduce_1  1# happyReduction_34
-happyReduction_34 happy_x_1
-	 =  case happyOutTok happy_x_1 of { (PT _ (TV happy_var_1)) -> 
-	happyIn37
-		 (Ident happy_var_1
-	)}
-
-happyReduce_35 = happySpecReduce_1  2# happyReduction_35
-happyReduction_35 happy_x_1
-	 =  case happyOutTok happy_x_1 of { (PT _ (TI happy_var_1)) -> 
-	happyIn38
-		 ((read ( happy_var_1)) :: Integer
-	)}
-
-happyReduce_36 = happySpecReduce_1  3# happyReduction_36
-happyReduction_36 happy_x_1
-	 =  case happyOutTok happy_x_1 of { (PT _ (TC happy_var_1)) -> 
-	happyIn39
-		 ((read ( happy_var_1)) :: Char
-	)}
-
-happyReduce_37 = happySpecReduce_1  4# happyReduction_37
-happyReduction_37 happy_x_1
-	 =  case happyOutTok happy_x_1 of { (PT _ (TD happy_var_1)) -> 
-	happyIn40
-		 ((read ( happy_var_1)) :: Double
-	)}
-
-happyReduce_38 = happySpecReduce_1  5# happyReduction_38
-happyReduction_38 happy_x_1
-	 =  case happyOut43 happy_x_1 of { happy_var_1 -> 
-	happyIn41
-		 (LGr happy_var_1
-	)}
-
-happyReduce_39 = happySpecReduce_1  6# happyReduction_39
-happyReduction_39 happy_x_1
-	 =  case happyOut47 happy_x_1 of { happy_var_1 -> 
-	happyIn42
-		 (DefAll happy_var_1
-	)}
-
-happyReduce_40 = happySpecReduce_3  6# happyReduction_40
-happyReduction_40 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut73 happy_x_1 of { happy_var_1 -> 
-	case happyOut47 happy_x_3 of { happy_var_3 -> 
-	happyIn42
-		 (DefSome happy_var_1 happy_var_3
-	)}}
-
-happyReduce_41 = happySpecReduce_2  6# happyReduction_41
-happyReduction_41 happy_x_2
-	happy_x_1
-	 =  case happyOut73 happy_x_2 of { happy_var_2 -> 
-	happyIn42
-		 (LDefView happy_var_2
-	)}
-
-happyReduce_42 = happySpecReduce_0  7# happyReduction_42
-happyReduction_42  =  happyIn43
-		 ([]
-	)
-
-happyReduce_43 = happySpecReduce_1  7# happyReduction_43
-happyReduction_43 happy_x_1
-	 =  case happyOut42 happy_x_1 of { happy_var_1 -> 
-	happyIn43
-		 ((:[]) happy_var_1
-	)}
-
-happyReduce_44 = happySpecReduce_3  7# happyReduction_44
-happyReduction_44 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut42 happy_x_1 of { happy_var_1 -> 
-	case happyOut43 happy_x_3 of { happy_var_3 -> 
-	happyIn43
-		 ((:) happy_var_1 happy_var_3
-	)}}
-
-happyReduce_45 = happySpecReduce_1  8# happyReduction_45
-happyReduction_45 happy_x_1
-	 =  case happyOut45 happy_x_1 of { happy_var_1 -> 
-	happyIn44
-		 (Grammar happy_var_1
-	)}
-
-happyReduce_46 = happySpecReduce_0  9# happyReduction_46
-happyReduction_46  =  happyIn45
-		 ([]
-	)
-
-happyReduce_47 = happySpecReduce_1  9# happyReduction_47
-happyReduction_47 happy_x_1
-	 =  case happyOut47 happy_x_1 of { happy_var_1 -> 
-	happyIn45
-		 ((:[]) happy_var_1
-	)}
-
-happyReduce_48 = happySpecReduce_3  9# happyReduction_48
-happyReduction_48 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut47 happy_x_1 of { happy_var_1 -> 
-	case happyOut45 happy_x_3 of { happy_var_3 -> 
-	happyIn45
-		 ((:) happy_var_1 happy_var_3
-	)}}
-
-happyReduce_49 = happySpecReduce_0  10# happyReduction_49
-happyReduction_49  =  happyIn46
-		 ([]
-	)
-
-happyReduce_50 = happySpecReduce_2  10# happyReduction_50
-happyReduction_50 happy_x_2
-	happy_x_1
-	 =  case happyOut46 happy_x_1 of { happy_var_1 -> 
-	case happyOut48 happy_x_2 of { happy_var_2 -> 
-	happyIn46
-		 (flip (:) happy_var_1 happy_var_2
-	)}}
-
-happyReduce_51 = happyReduce 5# 11# happyReduction_51
-happyReduction_51 (happy_x_5 `HappyStk`
-	happy_x_4 `HappyStk`
-	happy_x_3 `HappyStk`
-	happy_x_2 `HappyStk`
-	happy_x_1 `HappyStk`
-	happyRest)
-	 = case happyOut50 happy_x_1 of { happy_var_1 -> 
-	case happyOut49 happy_x_3 of { happy_var_3 -> 
-	case happyOut46 happy_x_5 of { happy_var_5 -> 
-	happyIn47
-		 (Rule happy_var_1 happy_var_3 (reverse happy_var_5)
-	) `HappyStk` happyRest}}}
-
-happyReduce_52 = happySpecReduce_2  11# happyReduction_52
-happyReduction_52 happy_x_2
-	happy_x_1
-	 =  case happyOut36 happy_x_2 of { happy_var_2 -> 
-	happyIn47
-		 (Comment happy_var_2
-	)}
-
-happyReduce_53 = happySpecReduce_3  11# happyReduction_53
-happyReduction_53 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut36 happy_x_2 of { happy_var_2 -> 
-	case happyOut36 happy_x_3 of { happy_var_3 -> 
-	happyIn47
-		 (Comments happy_var_2 happy_var_3
-	)}}
-
-happyReduce_54 = happyReduce 6# 11# happyReduction_54
-happyReduction_54 (happy_x_6 `HappyStk`
-	happy_x_5 `HappyStk`
-	happy_x_4 `HappyStk`
-	happy_x_3 `HappyStk`
-	happy_x_2 `HappyStk`
-	happy_x_1 `HappyStk`
-	happyRest)
-	 = case happyOut50 happy_x_2 of { happy_var_2 -> 
-	case happyOut49 happy_x_4 of { happy_var_4 -> 
-	case happyOut46 happy_x_6 of { happy_var_6 -> 
-	happyIn47
-		 (Internal happy_var_2 happy_var_4 (reverse happy_var_6)
-	) `HappyStk` happyRest}}}
-
-happyReduce_55 = happySpecReduce_3  11# happyReduction_55
-happyReduction_55 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut37 happy_x_2 of { happy_var_2 -> 
-	case happyOut72 happy_x_3 of { happy_var_3 -> 
-	happyIn47
-		 (Token happy_var_2 happy_var_3
-	)}}
-
-happyReduce_56 = happyReduce 4# 11# happyReduction_56
-happyReduction_56 (happy_x_4 `HappyStk`
-	happy_x_3 `HappyStk`
-	happy_x_2 `HappyStk`
-	happy_x_1 `HappyStk`
-	happyRest)
-	 = case happyOut37 happy_x_3 of { happy_var_3 -> 
-	case happyOut72 happy_x_4 of { happy_var_4 -> 
-	happyIn47
-		 (PosToken happy_var_3 happy_var_4
-	) `HappyStk` happyRest}}
-
-happyReduce_57 = happySpecReduce_2  11# happyReduction_57
-happyReduction_57 happy_x_2
-	happy_x_1
-	 =  case happyOut73 happy_x_2 of { happy_var_2 -> 
-	happyIn47
-		 (Entryp happy_var_2
-	)}
-
-happyReduce_58 = happyReduce 4# 11# happyReduction_58
-happyReduction_58 (happy_x_4 `HappyStk`
-	happy_x_3 `HappyStk`
-	happy_x_2 `HappyStk`
-	happy_x_1 `HappyStk`
-	happyRest)
-	 = case happyOut68 happy_x_2 of { happy_var_2 -> 
-	case happyOut49 happy_x_3 of { happy_var_3 -> 
-	case happyOut36 happy_x_4 of { happy_var_4 -> 
-	happyIn47
-		 (Separator happy_var_2 happy_var_3 happy_var_4
-	) `HappyStk` happyRest}}}
-
-happyReduce_59 = happyReduce 4# 11# happyReduction_59
-happyReduction_59 (happy_x_4 `HappyStk`
-	happy_x_3 `HappyStk`
-	happy_x_2 `HappyStk`
-	happy_x_1 `HappyStk`
-	happyRest)
-	 = case happyOut68 happy_x_2 of { happy_var_2 -> 
-	case happyOut49 happy_x_3 of { happy_var_3 -> 
-	case happyOut36 happy_x_4 of { happy_var_4 -> 
-	happyIn47
-		 (Terminator happy_var_2 happy_var_3 happy_var_4
-	) `HappyStk` happyRest}}}
-
-happyReduce_60 = happyReduce 6# 11# happyReduction_60
-happyReduction_60 (happy_x_6 `HappyStk`
-	happy_x_5 `HappyStk`
-	happy_x_4 `HappyStk`
-	happy_x_3 `HappyStk`
-	happy_x_2 `HappyStk`
-	happy_x_1 `HappyStk`
-	happyRest)
-	 = case happyOut49 happy_x_2 of { happy_var_2 -> 
-	case happyOut36 happy_x_3 of { happy_var_3 -> 
-	case happyOut36 happy_x_4 of { happy_var_4 -> 
-	case happyOut57 happy_x_5 of { happy_var_5 -> 
-	case happyOut68 happy_x_6 of { happy_var_6 -> 
-	happyIn47
-		 (Delimiters happy_var_2 happy_var_3 happy_var_4 happy_var_5 happy_var_6
-	) `HappyStk` happyRest}}}}}
-
-happyReduce_61 = happySpecReduce_3  11# happyReduction_61
-happyReduction_61 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut37 happy_x_2 of { happy_var_2 -> 
-	case happyOut38 happy_x_3 of { happy_var_3 -> 
-	happyIn47
-		 (Coercions happy_var_2 happy_var_3
-	)}}
-
-happyReduce_62 = happyReduce 4# 11# happyReduction_62
-happyReduction_62 (happy_x_4 `HappyStk`
-	happy_x_3 `HappyStk`
-	happy_x_2 `HappyStk`
-	happy_x_1 `HappyStk`
-	happyRest)
-	 = case happyOut37 happy_x_2 of { happy_var_2 -> 
-	case happyOut66 happy_x_4 of { happy_var_4 -> 
-	happyIn47
-		 (Rules happy_var_2 happy_var_4
-	) `HappyStk` happyRest}}
-
-happyReduce_63 = happyReduce 5# 11# happyReduction_63
-happyReduction_63 (happy_x_5 `HappyStk`
-	happy_x_4 `HappyStk`
-	happy_x_3 `HappyStk`
-	happy_x_2 `HappyStk`
-	happy_x_1 `HappyStk`
-	happyRest)
-	 = case happyOut37 happy_x_2 of { happy_var_2 -> 
-	case happyOut59 happy_x_3 of { happy_var_3 -> 
-	case happyOut60 happy_x_5 of { happy_var_5 -> 
-	happyIn47
-		 (Function happy_var_2 (reverse happy_var_3) happy_var_5
-	) `HappyStk` happyRest}}}
-
-happyReduce_64 = happySpecReduce_2  11# happyReduction_64
-happyReduction_64 happy_x_2
-	happy_x_1
-	 =  case happyOut65 happy_x_2 of { happy_var_2 -> 
-	happyIn47
-		 (Layout happy_var_2
-	)}
-
-happyReduce_65 = happySpecReduce_3  11# happyReduction_65
-happyReduction_65 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut65 happy_x_3 of { happy_var_3 -> 
-	happyIn47
-		 (LayoutStop happy_var_3
-	)}
-
-happyReduce_66 = happySpecReduce_2  11# happyReduction_66
-happyReduction_66 happy_x_2
-	happy_x_1
-	 =  happyIn47
-		 (LayoutTop
-	)
-
-happyReduce_67 = happySpecReduce_1  12# happyReduction_67
-happyReduction_67 happy_x_1
-	 =  case happyOut36 happy_x_1 of { happy_var_1 -> 
-	happyIn48
-		 (Terminal happy_var_1
-	)}
-
-happyReduce_68 = happySpecReduce_1  12# happyReduction_68
-happyReduction_68 happy_x_1
-	 =  case happyOut49 happy_x_1 of { happy_var_1 -> 
-	happyIn48
-		 (NTerminal happy_var_1
-	)}
-
-happyReduce_69 = happySpecReduce_3  13# happyReduction_69
-happyReduction_69 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut49 happy_x_2 of { happy_var_2 -> 
-	happyIn49
-		 (ListCat happy_var_2
-	)}
-
-happyReduce_70 = happySpecReduce_1  13# happyReduction_70
-happyReduction_70 happy_x_1
-	 =  case happyOut37 happy_x_1 of { happy_var_1 -> 
-	happyIn49
-		 (IdCat happy_var_1
-	)}
-
-happyReduce_71 = happySpecReduce_1  14# happyReduction_71
-happyReduction_71 happy_x_1
-	 =  case happyOut51 happy_x_1 of { happy_var_1 -> 
-	happyIn50
-		 (LabNoP happy_var_1
-	)}
-
-happyReduce_72 = happySpecReduce_2  14# happyReduction_72
-happyReduction_72 happy_x_2
-	happy_x_1
-	 =  case happyOut51 happy_x_1 of { happy_var_1 -> 
-	case happyOut56 happy_x_2 of { happy_var_2 -> 
-	happyIn50
-		 (LabP happy_var_1 happy_var_2
-	)}}
-
-happyReduce_73 = happySpecReduce_3  14# happyReduction_73
-happyReduction_73 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut51 happy_x_1 of { happy_var_1 -> 
-	case happyOut51 happy_x_2 of { happy_var_2 -> 
-	case happyOut56 happy_x_3 of { happy_var_3 -> 
-	happyIn50
-		 (LabPF happy_var_1 happy_var_2 happy_var_3
-	)}}}
-
-happyReduce_74 = happySpecReduce_2  14# happyReduction_74
-happyReduction_74 happy_x_2
-	happy_x_1
-	 =  case happyOut51 happy_x_1 of { happy_var_1 -> 
-	case happyOut51 happy_x_2 of { happy_var_2 -> 
-	happyIn50
-		 (LabF happy_var_1 happy_var_2
-	)}}
-
-happyReduce_75 = happySpecReduce_1  15# happyReduction_75
-happyReduction_75 happy_x_1
-	 =  case happyOut37 happy_x_1 of { happy_var_1 -> 
-	happyIn51
-		 (Id happy_var_1
-	)}
-
-happyReduce_76 = happySpecReduce_1  15# happyReduction_76
-happyReduction_76 happy_x_1
-	 =  happyIn51
-		 (Wild
-	)
-
-happyReduce_77 = happySpecReduce_2  15# happyReduction_77
-happyReduction_77 happy_x_2
-	happy_x_1
-	 =  happyIn51
-		 (ListE
-	)
-
-happyReduce_78 = happySpecReduce_3  15# happyReduction_78
-happyReduction_78 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  happyIn51
-		 (ListCons
-	)
-
-happyReduce_79 = happyReduce 5# 15# happyReduction_79
-happyReduction_79 (happy_x_5 `HappyStk`
-	happy_x_4 `HappyStk`
-	happy_x_3 `HappyStk`
-	happy_x_2 `HappyStk`
-	happy_x_1 `HappyStk`
-	happyRest)
-	 = happyIn51
-		 (ListOne
-	) `HappyStk` happyRest
-
-happyReduce_80 = happyReduce 9# 16# happyReduction_80
-happyReduction_80 (happy_x_9 `HappyStk`
-	happy_x_8 `HappyStk`
-	happy_x_7 `HappyStk`
-	happy_x_6 `HappyStk`
-	happy_x_5 `HappyStk`
-	happy_x_4 `HappyStk`
-	happy_x_3 `HappyStk`
-	happy_x_2 `HappyStk`
-	happy_x_1 `HappyStk`
-	happyRest)
-	 = case happyOut55 happy_x_3 of { happy_var_3 -> 
-	case happyOut54 happy_x_7 of { happy_var_7 -> 
-	happyIn52
-		 (ProfIt happy_var_3 happy_var_7
-	) `HappyStk` happyRest}}
-
-happyReduce_81 = happySpecReduce_3  17# happyReduction_81
-happyReduction_81 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut54 happy_x_2 of { happy_var_2 -> 
-	happyIn53
-		 (Ints happy_var_2
-	)}
-
-happyReduce_82 = happySpecReduce_0  18# happyReduction_82
-happyReduction_82  =  happyIn54
-		 ([]
-	)
-
-happyReduce_83 = happySpecReduce_1  18# happyReduction_83
-happyReduction_83 happy_x_1
-	 =  case happyOut38 happy_x_1 of { happy_var_1 -> 
-	happyIn54
-		 ((:[]) happy_var_1
-	)}
-
-happyReduce_84 = happySpecReduce_3  18# happyReduction_84
-happyReduction_84 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut38 happy_x_1 of { happy_var_1 -> 
-	case happyOut54 happy_x_3 of { happy_var_3 -> 
-	happyIn54
-		 ((:) happy_var_1 happy_var_3
-	)}}
-
-happyReduce_85 = happySpecReduce_0  19# happyReduction_85
-happyReduction_85  =  happyIn55
-		 ([]
-	)
-
-happyReduce_86 = happySpecReduce_1  19# happyReduction_86
-happyReduction_86 happy_x_1
-	 =  case happyOut53 happy_x_1 of { happy_var_1 -> 
-	happyIn55
-		 ((:[]) happy_var_1
-	)}
-
-happyReduce_87 = happySpecReduce_3  19# happyReduction_87
-happyReduction_87 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut53 happy_x_1 of { happy_var_1 -> 
-	case happyOut55 happy_x_3 of { happy_var_3 -> 
-	happyIn55
-		 ((:) happy_var_1 happy_var_3
-	)}}
-
-happyReduce_88 = happySpecReduce_1  20# happyReduction_88
-happyReduction_88 happy_x_1
-	 =  case happyOut52 happy_x_1 of { happy_var_1 -> 
-	happyIn56
-		 ((:[]) happy_var_1
-	)}
-
-happyReduce_89 = happySpecReduce_2  20# happyReduction_89
-happyReduction_89 happy_x_2
-	happy_x_1
-	 =  case happyOut52 happy_x_1 of { happy_var_1 -> 
-	case happyOut56 happy_x_2 of { happy_var_2 -> 
-	happyIn56
-		 ((:) happy_var_1 happy_var_2
-	)}}
-
-happyReduce_90 = happySpecReduce_0  21# happyReduction_90
-happyReduction_90  =  happyIn57
-		 (SepNone
-	)
-
-happyReduce_91 = happySpecReduce_2  21# happyReduction_91
-happyReduction_91 happy_x_2
-	happy_x_1
-	 =  case happyOut36 happy_x_2 of { happy_var_2 -> 
-	happyIn57
-		 (SepTerm happy_var_2
-	)}
-
-happyReduce_92 = happySpecReduce_2  21# happyReduction_92
-happyReduction_92 happy_x_2
-	happy_x_1
-	 =  case happyOut36 happy_x_2 of { happy_var_2 -> 
-	happyIn57
-		 (SepSepar happy_var_2
-	)}
-
-happyReduce_93 = happySpecReduce_1  22# happyReduction_93
-happyReduction_93 happy_x_1
-	 =  case happyOut37 happy_x_1 of { happy_var_1 -> 
-	happyIn58
-		 (Arg happy_var_1
-	)}
-
-happyReduce_94 = happySpecReduce_0  23# happyReduction_94
-happyReduction_94  =  happyIn59
-		 ([]
-	)
-
-happyReduce_95 = happySpecReduce_2  23# happyReduction_95
-happyReduction_95 happy_x_2
-	happy_x_1
-	 =  case happyOut59 happy_x_1 of { happy_var_1 -> 
-	case happyOut58 happy_x_2 of { happy_var_2 -> 
-	happyIn59
-		 (flip (:) happy_var_1 happy_var_2
-	)}}
-
-happyReduce_96 = happySpecReduce_3  24# happyReduction_96
-happyReduction_96 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut61 happy_x_1 of { happy_var_1 -> 
-	case happyOut60 happy_x_3 of { happy_var_3 -> 
-	happyIn60
-		 (Cons happy_var_1 happy_var_3
-	)}}
-
-happyReduce_97 = happySpecReduce_1  24# happyReduction_97
-happyReduction_97 happy_x_1
-	 =  case happyOut61 happy_x_1 of { happy_var_1 -> 
-	happyIn60
-		 (happy_var_1
-	)}
-
-happyReduce_98 = happySpecReduce_2  25# happyReduction_98
-happyReduction_98 happy_x_2
-	happy_x_1
-	 =  case happyOut37 happy_x_1 of { happy_var_1 -> 
-	case happyOut63 happy_x_2 of { happy_var_2 -> 
-	happyIn61
-		 (App happy_var_1 happy_var_2
-	)}}
-
-happyReduce_99 = happySpecReduce_1  25# happyReduction_99
-happyReduction_99 happy_x_1
-	 =  case happyOut62 happy_x_1 of { happy_var_1 -> 
-	happyIn61
-		 (happy_var_1
-	)}
-
-happyReduce_100 = happySpecReduce_1  26# happyReduction_100
-happyReduction_100 happy_x_1
-	 =  case happyOut37 happy_x_1 of { happy_var_1 -> 
-	happyIn62
-		 (Var happy_var_1
-	)}
-
-happyReduce_101 = happySpecReduce_1  26# happyReduction_101
-happyReduction_101 happy_x_1
-	 =  case happyOut38 happy_x_1 of { happy_var_1 -> 
-	happyIn62
-		 (LitInt happy_var_1
-	)}
-
-happyReduce_102 = happySpecReduce_1  26# happyReduction_102
-happyReduction_102 happy_x_1
-	 =  case happyOut39 happy_x_1 of { happy_var_1 -> 
-	happyIn62
-		 (LitChar happy_var_1
-	)}
-
-happyReduce_103 = happySpecReduce_1  26# happyReduction_103
-happyReduction_103 happy_x_1
-	 =  case happyOut36 happy_x_1 of { happy_var_1 -> 
-	happyIn62
-		 (LitString happy_var_1
-	)}
-
-happyReduce_104 = happySpecReduce_1  26# happyReduction_104
-happyReduction_104 happy_x_1
-	 =  case happyOut40 happy_x_1 of { happy_var_1 -> 
-	happyIn62
-		 (LitDouble happy_var_1
-	)}
-
-happyReduce_105 = happySpecReduce_3  26# happyReduction_105
-happyReduction_105 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut64 happy_x_2 of { happy_var_2 -> 
-	happyIn62
-		 (List happy_var_2
-	)}
-
-happyReduce_106 = happySpecReduce_3  26# happyReduction_106
-happyReduction_106 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut60 happy_x_2 of { happy_var_2 -> 
-	happyIn62
-		 (happy_var_2
-	)}
-
-happyReduce_107 = happySpecReduce_1  27# happyReduction_107
-happyReduction_107 happy_x_1
-	 =  case happyOut62 happy_x_1 of { happy_var_1 -> 
-	happyIn63
-		 ((:[]) happy_var_1
-	)}
-
-happyReduce_108 = happySpecReduce_2  27# happyReduction_108
-happyReduction_108 happy_x_2
-	happy_x_1
-	 =  case happyOut62 happy_x_1 of { happy_var_1 -> 
-	case happyOut63 happy_x_2 of { happy_var_2 -> 
-	happyIn63
-		 ((:) happy_var_1 happy_var_2
-	)}}
-
-happyReduce_109 = happySpecReduce_0  28# happyReduction_109
-happyReduction_109  =  happyIn64
-		 ([]
-	)
-
-happyReduce_110 = happySpecReduce_1  28# happyReduction_110
-happyReduction_110 happy_x_1
-	 =  case happyOut60 happy_x_1 of { happy_var_1 -> 
-	happyIn64
-		 ((:[]) happy_var_1
-	)}
-
-happyReduce_111 = happySpecReduce_3  28# happyReduction_111
-happyReduction_111 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut60 happy_x_1 of { happy_var_1 -> 
-	case happyOut64 happy_x_3 of { happy_var_3 -> 
-	happyIn64
-		 ((:) happy_var_1 happy_var_3
-	)}}
-
-happyReduce_112 = happySpecReduce_1  29# happyReduction_112
-happyReduction_112 happy_x_1
-	 =  case happyOut36 happy_x_1 of { happy_var_1 -> 
-	happyIn65
-		 ((:[]) happy_var_1
-	)}
-
-happyReduce_113 = happySpecReduce_3  29# happyReduction_113
-happyReduction_113 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut36 happy_x_1 of { happy_var_1 -> 
-	case happyOut65 happy_x_3 of { happy_var_3 -> 
-	happyIn65
-		 ((:) happy_var_1 happy_var_3
-	)}}
-
-happyReduce_114 = happySpecReduce_1  30# happyReduction_114
-happyReduction_114 happy_x_1
-	 =  case happyOut67 happy_x_1 of { happy_var_1 -> 
-	happyIn66
-		 ((:[]) happy_var_1
-	)}
-
-happyReduce_115 = happySpecReduce_3  30# happyReduction_115
-happyReduction_115 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut67 happy_x_1 of { happy_var_1 -> 
-	case happyOut66 happy_x_3 of { happy_var_3 -> 
-	happyIn66
-		 ((:) happy_var_1 happy_var_3
-	)}}
-
-happyReduce_116 = happySpecReduce_1  31# happyReduction_116
-happyReduction_116 happy_x_1
-	 =  case happyOut46 happy_x_1 of { happy_var_1 -> 
-	happyIn67
-		 (RHS (reverse happy_var_1)
-	)}
-
-happyReduce_117 = happySpecReduce_1  32# happyReduction_117
-happyReduction_117 happy_x_1
-	 =  happyIn68
-		 (MNonempty
-	)
-
-happyReduce_118 = happySpecReduce_0  32# happyReduction_118
-happyReduction_118  =  happyIn68
-		 (MEmpty
-	)
-
-happyReduce_119 = happySpecReduce_2  33# happyReduction_119
-happyReduction_119 happy_x_2
-	happy_x_1
-	 =  case happyOut69 happy_x_1 of { happy_var_1 -> 
-	case happyOut71 happy_x_2 of { happy_var_2 -> 
-	happyIn69
-		 (RSeq happy_var_1 happy_var_2
-	)}}
-
-happyReduce_120 = happySpecReduce_1  33# happyReduction_120
-happyReduction_120 happy_x_1
-	 =  case happyOut71 happy_x_1 of { happy_var_1 -> 
-	happyIn69
-		 (happy_var_1
-	)}
-
-happyReduce_121 = happySpecReduce_3  34# happyReduction_121
-happyReduction_121 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut70 happy_x_1 of { happy_var_1 -> 
-	case happyOut69 happy_x_3 of { happy_var_3 -> 
-	happyIn70
-		 (RAlt happy_var_1 happy_var_3
-	)}}
-
-happyReduce_122 = happySpecReduce_3  34# happyReduction_122
-happyReduction_122 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut69 happy_x_1 of { happy_var_1 -> 
-	case happyOut69 happy_x_3 of { happy_var_3 -> 
-	happyIn70
-		 (RMinus happy_var_1 happy_var_3
-	)}}
-
-happyReduce_123 = happySpecReduce_1  34# happyReduction_123
-happyReduction_123 happy_x_1
-	 =  case happyOut69 happy_x_1 of { happy_var_1 -> 
-	happyIn70
-		 (happy_var_1
-	)}
-
-happyReduce_124 = happySpecReduce_2  35# happyReduction_124
-happyReduction_124 happy_x_2
-	happy_x_1
-	 =  case happyOut71 happy_x_1 of { happy_var_1 -> 
-	happyIn71
-		 (RStar happy_var_1
-	)}
-
-happyReduce_125 = happySpecReduce_2  35# happyReduction_125
-happyReduction_125 happy_x_2
-	happy_x_1
-	 =  case happyOut71 happy_x_1 of { happy_var_1 -> 
-	happyIn71
-		 (RPlus happy_var_1
-	)}
-
-happyReduce_126 = happySpecReduce_2  35# happyReduction_126
-happyReduction_126 happy_x_2
-	happy_x_1
-	 =  case happyOut71 happy_x_1 of { happy_var_1 -> 
-	happyIn71
-		 (ROpt happy_var_1
-	)}
-
-happyReduce_127 = happySpecReduce_1  35# happyReduction_127
-happyReduction_127 happy_x_1
-	 =  happyIn71
-		 (REps
-	)
-
-happyReduce_128 = happySpecReduce_1  35# happyReduction_128
-happyReduction_128 happy_x_1
-	 =  case happyOut39 happy_x_1 of { happy_var_1 -> 
-	happyIn71
-		 (RChar happy_var_1
-	)}
-
-happyReduce_129 = happySpecReduce_3  35# happyReduction_129
-happyReduction_129 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut36 happy_x_2 of { happy_var_2 -> 
-	happyIn71
-		 (RAlts happy_var_2
-	)}
-
-happyReduce_130 = happySpecReduce_3  35# happyReduction_130
-happyReduction_130 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut36 happy_x_2 of { happy_var_2 -> 
-	happyIn71
-		 (RSeqs happy_var_2
-	)}
-
-happyReduce_131 = happySpecReduce_1  35# happyReduction_131
-happyReduction_131 happy_x_1
-	 =  happyIn71
-		 (RDigit
-	)
-
-happyReduce_132 = happySpecReduce_1  35# happyReduction_132
-happyReduction_132 happy_x_1
-	 =  happyIn71
-		 (RLetter
-	)
-
-happyReduce_133 = happySpecReduce_1  35# happyReduction_133
-happyReduction_133 happy_x_1
-	 =  happyIn71
-		 (RUpper
-	)
-
-happyReduce_134 = happySpecReduce_1  35# happyReduction_134
-happyReduction_134 happy_x_1
-	 =  happyIn71
-		 (RLower
-	)
-
-happyReduce_135 = happySpecReduce_1  35# happyReduction_135
-happyReduction_135 happy_x_1
-	 =  happyIn71
-		 (RAny
-	)
-
-happyReduce_136 = happySpecReduce_3  35# happyReduction_136
-happyReduction_136 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut72 happy_x_2 of { happy_var_2 -> 
-	happyIn71
-		 (happy_var_2
-	)}
-
-happyReduce_137 = happySpecReduce_1  36# happyReduction_137
-happyReduction_137 happy_x_1
-	 =  case happyOut70 happy_x_1 of { happy_var_1 -> 
-	happyIn72
-		 (happy_var_1
-	)}
-
-happyReduce_138 = happySpecReduce_1  37# happyReduction_138
-happyReduction_138 happy_x_1
-	 =  case happyOut37 happy_x_1 of { happy_var_1 -> 
-	happyIn73
-		 ((:[]) happy_var_1
-	)}
-
-happyReduce_139 = happySpecReduce_3  37# happyReduction_139
-happyReduction_139 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut37 happy_x_1 of { happy_var_1 -> 
-	case happyOut73 happy_x_3 of { happy_var_3 -> 
-	happyIn73
-		 ((:) happy_var_1 happy_var_3
-	)}}
-
-happyNewToken action sts stk [] =
-	happyDoAction 46# notHappyAtAll action sts stk []
-
-happyNewToken action sts stk (tk:tks) =
-	let cont i = happyDoAction i tk action sts stk tks in
-	case tk of {
-	PT _ (TS _ 1) -> cont 1#;
-	PT _ (TS _ 2) -> cont 2#;
-	PT _ (TS _ 3) -> cont 3#;
-	PT _ (TS _ 4) -> cont 4#;
-	PT _ (TS _ 5) -> cont 5#;
-	PT _ (TS _ 6) -> cont 6#;
-	PT _ (TS _ 7) -> cont 7#;
-	PT _ (TS _ 8) -> cont 8#;
-	PT _ (TS _ 9) -> cont 9#;
-	PT _ (TS _ 10) -> cont 10#;
-	PT _ (TS _ 11) -> cont 11#;
-	PT _ (TS _ 12) -> cont 12#;
-	PT _ (TS _ 13) -> cont 13#;
-	PT _ (TS _ 14) -> cont 14#;
-	PT _ (TS _ 15) -> cont 15#;
-	PT _ (TS _ 16) -> cont 16#;
-	PT _ (TS _ 17) -> cont 17#;
-	PT _ (TS _ 18) -> cont 18#;
-	PT _ (TS _ 19) -> cont 19#;
-	PT _ (TS _ 20) -> cont 20#;
-	PT _ (TS _ 21) -> cont 21#;
-	PT _ (TS _ 22) -> cont 22#;
-	PT _ (TS _ 23) -> cont 23#;
-	PT _ (TS _ 24) -> cont 24#;
-	PT _ (TS _ 25) -> cont 25#;
-	PT _ (TS _ 26) -> cont 26#;
-	PT _ (TS _ 27) -> cont 27#;
-	PT _ (TS _ 28) -> cont 28#;
-	PT _ (TS _ 29) -> cont 29#;
-	PT _ (TS _ 30) -> cont 30#;
-	PT _ (TS _ 31) -> cont 31#;
-	PT _ (TS _ 32) -> cont 32#;
-	PT _ (TS _ 33) -> cont 33#;
-	PT _ (TS _ 34) -> cont 34#;
-	PT _ (TS _ 35) -> cont 35#;
-	PT _ (TS _ 36) -> cont 36#;
-	PT _ (TS _ 37) -> cont 37#;
-	PT _ (TS _ 38) -> cont 38#;
-	PT _ (TS _ 39) -> cont 39#;
-	PT _ (TS _ 40) -> cont 40#;
-	PT _ (TL happy_dollar_dollar) -> cont 41#;
-	PT _ (TV happy_dollar_dollar) -> cont 42#;
-	PT _ (TI happy_dollar_dollar) -> cont 43#;
-	PT _ (TC happy_dollar_dollar) -> cont 44#;
-	PT _ (TD happy_dollar_dollar) -> cont 45#;
-	_ -> happyError' (tk:tks)
-	}
-
-happyError_ 46# tk tks = happyError' tks
-happyError_ _ tk tks = happyError' (tk:tks)
-
-happyThen :: () => Err a -> (a -> Err b) -> Err b
-happyThen = (thenM)
-happyReturn :: () => a -> Err a
-happyReturn = (returnM)
-happyThen1 m k tks = (thenM) m (\a -> k a tks)
-happyReturn1 :: () => a -> b -> Err a
-happyReturn1 = \a tks -> (returnM) a
-happyError' :: () => [(Token)] -> Err a
-happyError' = happyError
-
-pLGrammar tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 0# tks) (\x -> happyReturn (happyOut41 x))
-
-pLDef tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 1# tks) (\x -> happyReturn (happyOut42 x))
-
-pListLDef tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 2# tks) (\x -> happyReturn (happyOut43 x))
-
-pGrammar tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 3# tks) (\x -> happyReturn (happyOut44 x))
-
-pListDef tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 4# tks) (\x -> happyReturn (happyOut45 x))
-
-pListItem tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 5# tks) (\x -> happyReturn (happyOut46 x))
-
-pDef tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 6# tks) (\x -> happyReturn (happyOut47 x))
-
-pItem tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 7# tks) (\x -> happyReturn (happyOut48 x))
-
-pCat tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 8# tks) (\x -> happyReturn (happyOut49 x))
-
-pLabel tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 9# tks) (\x -> happyReturn (happyOut50 x))
-
-pLabelId tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 10# tks) (\x -> happyReturn (happyOut51 x))
-
-pProfItem tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 11# tks) (\x -> happyReturn (happyOut52 x))
-
-pIntList tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 12# tks) (\x -> happyReturn (happyOut53 x))
-
-pListInteger tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 13# tks) (\x -> happyReturn (happyOut54 x))
-
-pListIntList tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 14# tks) (\x -> happyReturn (happyOut55 x))
-
-pListProfItem tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 15# tks) (\x -> happyReturn (happyOut56 x))
-
-pSeparation tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 16# tks) (\x -> happyReturn (happyOut57 x))
-
-pArg tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 17# tks) (\x -> happyReturn (happyOut58 x))
-
-pListArg tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 18# tks) (\x -> happyReturn (happyOut59 x))
-
-pExp tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 19# tks) (\x -> happyReturn (happyOut60 x))
-
-pExp1 tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 20# tks) (\x -> happyReturn (happyOut61 x))
-
-pExp2 tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 21# tks) (\x -> happyReturn (happyOut62 x))
-
-pListExp2 tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 22# tks) (\x -> happyReturn (happyOut63 x))
-
-pListExp tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 23# tks) (\x -> happyReturn (happyOut64 x))
-
-pListString tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 24# tks) (\x -> happyReturn (happyOut65 x))
-
-pListRHS tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 25# tks) (\x -> happyReturn (happyOut66 x))
-
-pRHS tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 26# tks) (\x -> happyReturn (happyOut67 x))
-
-pMinimumSize tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 27# tks) (\x -> happyReturn (happyOut68 x))
-
-pReg2 tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 28# tks) (\x -> happyReturn (happyOut69 x))
-
-pReg1 tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 29# tks) (\x -> happyReturn (happyOut70 x))
-
-pReg3 tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 30# tks) (\x -> happyReturn (happyOut71 x))
-
-pReg tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 31# tks) (\x -> happyReturn (happyOut72 x))
-
-pListIdent tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 32# tks) (\x -> happyReturn (happyOut73 x))
-
-happySeq = happyDontSeq
-
-
-returnM :: a -> Err a
-returnM = return
-
-thenM :: Err a -> (a -> Err b) -> Err b
-thenM = (>>=)
-
-happyError :: [Token] -> Err a
-happyError ts =
-  Bad $ "syntax error at " ++ tokenPos ts ++ 
-  case ts of
-    [] -> []
-    [Err _] -> " due to lexer error"
-    _ -> " before " ++ unwords (map (id . prToken) (take 4 ts))
-
-myLexer = tokens
-{-# LINE 1 "templates/GenericTemplate.hs" #-}
-{-# LINE 1 "templates/GenericTemplate.hs" #-}
-{-# LINE 1 "<built-in>" #-}
-{-# LINE 1 "<command-line>" #-}
-{-# LINE 10 "<command-line>" #-}
-# 1 "/usr/include/stdc-predef.h" 1 3 4
-
-# 17 "/usr/include/stdc-predef.h" 3 4
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-{-# LINE 10 "<command-line>" #-}
-{-# LINE 1 "templates/GenericTemplate.hs" #-}
--- Id: GenericTemplate.hs,v 1.26 2005/01/14 14:47:22 simonmar Exp 
-
-{-# LINE 13 "templates/GenericTemplate.hs" #-}
-
-
-
-
-
--- Do not remove this comment. Required to fix CPP parsing when using GCC and a clang-compiled alex.
-#if __GLASGOW_HASKELL__ > 706
-#define LT(n,m) ((Happy_GHC_Exts.tagToEnum# (n Happy_GHC_Exts.<# m)) :: Bool)
-#define GTE(n,m) ((Happy_GHC_Exts.tagToEnum# (n Happy_GHC_Exts.>=# m)) :: Bool)
-#define EQ(n,m) ((Happy_GHC_Exts.tagToEnum# (n Happy_GHC_Exts.==# m)) :: Bool)
-#else
-#define LT(n,m) (n Happy_GHC_Exts.<# m)
-#define GTE(n,m) (n Happy_GHC_Exts.>=# m)
-#define EQ(n,m) (n Happy_GHC_Exts.==# m)
-#endif
-{-# LINE 46 "templates/GenericTemplate.hs" #-}
-
-
-data Happy_IntList = HappyCons Happy_GHC_Exts.Int# Happy_IntList
-
-
-
-
-
-{-# LINE 67 "templates/GenericTemplate.hs" #-}
-
-{-# LINE 77 "templates/GenericTemplate.hs" #-}
-
-{-# LINE 86 "templates/GenericTemplate.hs" #-}
-
-infixr 9 `HappyStk`
-data HappyStk a = HappyStk a (HappyStk a)
-
------------------------------------------------------------------------------
--- starting the parse
-
-happyParse start_state = happyNewToken start_state notHappyAtAll notHappyAtAll
-
------------------------------------------------------------------------------
--- Accepting the parse
-
--- If the current token is 0#, it means we've just accepted a partial
--- parse (a %partial parser).  We must ignore the saved token on the top of
--- the stack in this case.
-happyAccept 0# tk st sts (_ `HappyStk` ans `HappyStk` _) =
-        happyReturn1 ans
-happyAccept j tk st sts (HappyStk ans _) = 
-        (happyTcHack j (happyTcHack st)) (happyReturn1 ans)
-
------------------------------------------------------------------------------
--- Arrays only: do the next action
-
-
-
-happyDoAction i tk st
-        = {- nothing -}
-
-
-          case action of
-                0#           -> {- nothing -}
-                                     happyFail i tk st
-                -1#          -> {- nothing -}
-                                     happyAccept i tk st
-                n | LT(n,(0# :: Happy_GHC_Exts.Int#)) -> {- nothing -}
-
-                                                   (happyReduceArr Happy_Data_Array.! rule) i tk st
-                                                   where rule = (Happy_GHC_Exts.I# ((Happy_GHC_Exts.negateInt# ((n Happy_GHC_Exts.+# (1# :: Happy_GHC_Exts.Int#))))))
-                n                 -> {- nothing -}
-
-
-                                     happyShift new_state i tk st
-                                     where new_state = (n Happy_GHC_Exts.-# (1# :: Happy_GHC_Exts.Int#))
-   where off    = indexShortOffAddr happyActOffsets st
-         off_i  = (off Happy_GHC_Exts.+# i)
-         check  = if GTE(off_i,(0# :: Happy_GHC_Exts.Int#))
-                  then EQ(indexShortOffAddr happyCheck off_i, i)
-                  else False
-         action
-          | check     = indexShortOffAddr happyTable off_i
-          | otherwise = indexShortOffAddr happyDefActions st
-
-
-indexShortOffAddr (HappyA# arr) off =
-        Happy_GHC_Exts.narrow16Int# i
-  where
-        i = Happy_GHC_Exts.word2Int# (Happy_GHC_Exts.or# (Happy_GHC_Exts.uncheckedShiftL# high 8#) low)
-        high = Happy_GHC_Exts.int2Word# (Happy_GHC_Exts.ord# (Happy_GHC_Exts.indexCharOffAddr# arr (off' Happy_GHC_Exts.+# 1#)))
-        low  = Happy_GHC_Exts.int2Word# (Happy_GHC_Exts.ord# (Happy_GHC_Exts.indexCharOffAddr# arr off'))
-        off' = off Happy_GHC_Exts.*# 2#
-
-
-
-
-
-data HappyAddr = HappyA# Happy_GHC_Exts.Addr#
-
-
-
-
------------------------------------------------------------------------------
--- HappyState data type (not arrays)
-
-{-# LINE 170 "templates/GenericTemplate.hs" #-}
-
------------------------------------------------------------------------------
--- Shifting a token
-
-happyShift new_state 0# tk st sts stk@(x `HappyStk` _) =
-     let i = (case Happy_GHC_Exts.unsafeCoerce# x of { (Happy_GHC_Exts.I# (i)) -> i }) in
---     trace "shifting the error token" $
-     happyDoAction i tk new_state (HappyCons (st) (sts)) (stk)
-
-happyShift new_state i tk st sts stk =
-     happyNewToken new_state (HappyCons (st) (sts)) ((happyInTok (tk))`HappyStk`stk)
-
--- happyReduce is specialised for the common cases.
-
-happySpecReduce_0 i fn 0# tk st sts stk
-     = happyFail 0# tk st sts stk
-happySpecReduce_0 nt fn j tk st@((action)) sts stk
-     = happyGoto nt j tk st (HappyCons (st) (sts)) (fn `HappyStk` stk)
-
-happySpecReduce_1 i fn 0# tk st sts stk
-     = happyFail 0# tk st sts stk
-happySpecReduce_1 nt fn j tk _ sts@((HappyCons (st@(action)) (_))) (v1`HappyStk`stk')
-     = let r = fn v1 in
-       happySeq r (happyGoto nt j tk st sts (r `HappyStk` stk'))
-
-happySpecReduce_2 i fn 0# tk st sts stk
-     = happyFail 0# tk st sts stk
-happySpecReduce_2 nt fn j tk _ (HappyCons (_) (sts@((HappyCons (st@(action)) (_))))) (v1`HappyStk`v2`HappyStk`stk')
-     = let r = fn v1 v2 in
-       happySeq r (happyGoto nt j tk st sts (r `HappyStk` stk'))
-
-happySpecReduce_3 i fn 0# tk st sts stk
-     = happyFail 0# tk st sts stk
-happySpecReduce_3 nt fn j tk _ (HappyCons (_) ((HappyCons (_) (sts@((HappyCons (st@(action)) (_))))))) (v1`HappyStk`v2`HappyStk`v3`HappyStk`stk')
-     = let r = fn v1 v2 v3 in
-       happySeq r (happyGoto nt j tk st sts (r `HappyStk` stk'))
-
-happyReduce k i fn 0# tk st sts stk
-     = happyFail 0# tk st sts stk
-happyReduce k nt fn j tk st sts stk
-     = case happyDrop (k Happy_GHC_Exts.-# (1# :: Happy_GHC_Exts.Int#)) sts of
-         sts1@((HappyCons (st1@(action)) (_))) ->
-                let r = fn stk in  -- it doesn't hurt to always seq here...
-                happyDoSeq r (happyGoto nt j tk st1 sts1 r)
-
-happyMonadReduce k nt fn 0# tk st sts stk
-     = happyFail 0# tk st sts stk
-happyMonadReduce k nt fn j tk st sts stk =
-      case happyDrop k (HappyCons (st) (sts)) of
-        sts1@((HappyCons (st1@(action)) (_))) ->
-          let drop_stk = happyDropStk k stk in
-          happyThen1 (fn stk tk) (\r -> happyGoto nt j tk st1 sts1 (r `HappyStk` drop_stk))
-
-happyMonad2Reduce k nt fn 0# tk st sts stk
-     = happyFail 0# tk st sts stk
-happyMonad2Reduce k nt fn j tk st sts stk =
-      case happyDrop k (HappyCons (st) (sts)) of
-        sts1@((HappyCons (st1@(action)) (_))) ->
-         let drop_stk = happyDropStk k stk
-
-             off = indexShortOffAddr happyGotoOffsets st1
-             off_i = (off Happy_GHC_Exts.+# nt)
-             new_state = indexShortOffAddr happyTable off_i
-
-
-
-          in
-          happyThen1 (fn stk tk) (\r -> happyNewToken new_state sts1 (r `HappyStk` drop_stk))
-
-happyDrop 0# l = l
-happyDrop n (HappyCons (_) (t)) = happyDrop (n Happy_GHC_Exts.-# (1# :: Happy_GHC_Exts.Int#)) t
-
-happyDropStk 0# l = l
-happyDropStk n (x `HappyStk` xs) = happyDropStk (n Happy_GHC_Exts.-# (1#::Happy_GHC_Exts.Int#)) xs
-
------------------------------------------------------------------------------
--- Moving to a new state after a reduction
-
-
-happyGoto nt j tk st = 
-   {- nothing -}
-   happyDoAction j tk new_state
-   where off = indexShortOffAddr happyGotoOffsets st
-         off_i = (off Happy_GHC_Exts.+# nt)
-         new_state = indexShortOffAddr happyTable off_i
-
-
-
-
------------------------------------------------------------------------------
--- Error recovery (0# is the error token)
-
--- parse error if we are in recovery and we fail again
-happyFail 0# tk old_st _ stk@(x `HappyStk` _) =
-     let i = (case Happy_GHC_Exts.unsafeCoerce# x of { (Happy_GHC_Exts.I# (i)) -> i }) in
---      trace "failing" $ 
-        happyError_ i tk
-
-{-  We don't need state discarding for our restricted implementation of
-    "error".  In fact, it can cause some bogus parses, so I've disabled it
-    for now --SDM
-
--- discard a state
-happyFail  0# tk old_st (HappyCons ((action)) (sts)) 
-                                                (saved_tok `HappyStk` _ `HappyStk` stk) =
---      trace ("discarding state, depth " ++ show (length stk))  $
-        happyDoAction 0# tk action sts ((saved_tok`HappyStk`stk))
--}
-
--- Enter error recovery: generate an error token,
---                       save the old token and carry on.
-happyFail  i tk (action) sts stk =
---      trace "entering error recovery" $
-        happyDoAction 0# tk action sts ( (Happy_GHC_Exts.unsafeCoerce# (Happy_GHC_Exts.I# (i))) `HappyStk` stk)
-
--- Internal happy errors:
-
-notHappyAtAll :: a
-notHappyAtAll = error "Internal Happy error\n"
-
------------------------------------------------------------------------------
--- Hack to get the typechecker to accept our action functions
-
-
-happyTcHack :: Happy_GHC_Exts.Int# -> a -> a
-happyTcHack x y = y
-{-# INLINE happyTcHack #-}
-
-
------------------------------------------------------------------------------
--- Seq-ing.  If the --strict flag is given, then Happy emits 
---      happySeq = happyDoSeq
--- otherwise it emits
---      happySeq = happyDontSeq
-
-happyDoSeq, happyDontSeq :: a -> b -> b
-happyDoSeq   a b = a `seq` b
-happyDontSeq a b = b
-
------------------------------------------------------------------------------
--- Don't inline any functions from the template.  GHC has a nasty habit
--- of deciding to inline happyGoto everywhere, which increases the size of
--- the generated parser quite a bit.
-
-
-{-# NOINLINE happyDoAction #-}
-{-# NOINLINE happyTable #-}
-{-# NOINLINE happyCheck #-}
-{-# NOINLINE happyActOffsets #-}
-{-# NOINLINE happyGotoOffsets #-}
-{-# NOINLINE happyDefActions #-}
-
-{-# NOINLINE happyShift #-}
-{-# NOINLINE happySpecReduce_0 #-}
-{-# NOINLINE happySpecReduce_1 #-}
-{-# NOINLINE happySpecReduce_2 #-}
-{-# NOINLINE happySpecReduce_3 #-}
-{-# NOINLINE happyReduce #-}
-{-# NOINLINE happyMonadReduce #-}
-{-# NOINLINE happyGoto #-}
-{-# NOINLINE happyFail #-}
-
--- end of Happy Template.
+{-# OPTIONS -XMagicHash -XBangPatterns -XTypeSynonymInstances -XFlexibleInstances -cpp #-}
+#if __GLASGOW_HASKELL__ >= 710
+{-# OPTIONS_GHC -XPartialTypeSignatures #-}
+#endif
+{-# OPTIONS_GHC -fno-warn-incomplete-patterns -fno-warn-overlapping-patterns #-}
+module ParBNF where
+import AbsBNF
+import LexBNF
+import ErrM
+import qualified Data.Array as Happy_Data_Array
+import qualified Data.Bits as Bits
+import qualified GHC.Exts as Happy_GHC_Exts
+import Control.Applicative(Applicative(..))
+import Control.Monad (ap)
+
+-- parser produced by Happy Version 1.19.8
+
+newtype HappyAbsSyn  = HappyAbsSyn HappyAny
+#if __GLASGOW_HASKELL__ >= 607
+type HappyAny = Happy_GHC_Exts.Any
+#else
+type HappyAny = forall a . a
+#endif
+happyIn36 :: (Ident) -> (HappyAbsSyn )
+happyIn36 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn36 #-}
+happyOut36 :: (HappyAbsSyn ) -> (Ident)
+happyOut36 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut36 #-}
+happyIn37 :: (String) -> (HappyAbsSyn )
+happyIn37 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn37 #-}
+happyOut37 :: (HappyAbsSyn ) -> (String)
+happyOut37 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut37 #-}
+happyIn38 :: (Integer) -> (HappyAbsSyn )
+happyIn38 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn38 #-}
+happyOut38 :: (HappyAbsSyn ) -> (Integer)
+happyOut38 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut38 #-}
+happyIn39 :: (Char) -> (HappyAbsSyn )
+happyIn39 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn39 #-}
+happyOut39 :: (HappyAbsSyn ) -> (Char)
+happyOut39 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut39 #-}
+happyIn40 :: (Double) -> (HappyAbsSyn )
+happyIn40 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn40 #-}
+happyOut40 :: (HappyAbsSyn ) -> (Double)
+happyOut40 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut40 #-}
+happyIn41 :: (LGrammar) -> (HappyAbsSyn )
+happyIn41 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn41 #-}
+happyOut41 :: (HappyAbsSyn ) -> (LGrammar)
+happyOut41 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut41 #-}
+happyIn42 :: (LDef) -> (HappyAbsSyn )
+happyIn42 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn42 #-}
+happyOut42 :: (HappyAbsSyn ) -> (LDef)
+happyOut42 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut42 #-}
+happyIn43 :: ([LDef]) -> (HappyAbsSyn )
+happyIn43 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn43 #-}
+happyOut43 :: (HappyAbsSyn ) -> ([LDef])
+happyOut43 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut43 #-}
+happyIn44 :: ([Ident]) -> (HappyAbsSyn )
+happyIn44 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn44 #-}
+happyOut44 :: (HappyAbsSyn ) -> ([Ident])
+happyOut44 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut44 #-}
+happyIn45 :: (Grammar) -> (HappyAbsSyn )
+happyIn45 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn45 #-}
+happyOut45 :: (HappyAbsSyn ) -> (Grammar)
+happyOut45 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut45 #-}
+happyIn46 :: ([Def]) -> (HappyAbsSyn )
+happyIn46 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn46 #-}
+happyOut46 :: (HappyAbsSyn ) -> ([Def])
+happyOut46 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut46 #-}
+happyIn47 :: (Def) -> (HappyAbsSyn )
+happyIn47 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn47 #-}
+happyOut47 :: (HappyAbsSyn ) -> (Def)
+happyOut47 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut47 #-}
+happyIn48 :: (Item) -> (HappyAbsSyn )
+happyIn48 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn48 #-}
+happyOut48 :: (HappyAbsSyn ) -> (Item)
+happyOut48 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut48 #-}
+happyIn49 :: ([Item]) -> (HappyAbsSyn )
+happyIn49 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn49 #-}
+happyOut49 :: (HappyAbsSyn ) -> ([Item])
+happyOut49 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut49 #-}
+happyIn50 :: (Cat) -> (HappyAbsSyn )
+happyIn50 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn50 #-}
+happyOut50 :: (HappyAbsSyn ) -> (Cat)
+happyOut50 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut50 #-}
+happyIn51 :: (Label) -> (HappyAbsSyn )
+happyIn51 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn51 #-}
+happyOut51 :: (HappyAbsSyn ) -> (Label)
+happyOut51 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut51 #-}
+happyIn52 :: (LabelId) -> (HappyAbsSyn )
+happyIn52 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn52 #-}
+happyOut52 :: (HappyAbsSyn ) -> (LabelId)
+happyOut52 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut52 #-}
+happyIn53 :: (ProfItem) -> (HappyAbsSyn )
+happyIn53 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn53 #-}
+happyOut53 :: (HappyAbsSyn ) -> (ProfItem)
+happyOut53 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut53 #-}
+happyIn54 :: (IntList) -> (HappyAbsSyn )
+happyIn54 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn54 #-}
+happyOut54 :: (HappyAbsSyn ) -> (IntList)
+happyOut54 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut54 #-}
+happyIn55 :: ([Integer]) -> (HappyAbsSyn )
+happyIn55 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn55 #-}
+happyOut55 :: (HappyAbsSyn ) -> ([Integer])
+happyOut55 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut55 #-}
+happyIn56 :: ([IntList]) -> (HappyAbsSyn )
+happyIn56 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn56 #-}
+happyOut56 :: (HappyAbsSyn ) -> ([IntList])
+happyOut56 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut56 #-}
+happyIn57 :: ([ProfItem]) -> (HappyAbsSyn )
+happyIn57 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn57 #-}
+happyOut57 :: (HappyAbsSyn ) -> ([ProfItem])
+happyOut57 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut57 #-}
+happyIn58 :: (Arg) -> (HappyAbsSyn )
+happyIn58 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn58 #-}
+happyOut58 :: (HappyAbsSyn ) -> (Arg)
+happyOut58 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut58 #-}
+happyIn59 :: ([Arg]) -> (HappyAbsSyn )
+happyIn59 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn59 #-}
+happyOut59 :: (HappyAbsSyn ) -> ([Arg])
+happyOut59 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut59 #-}
+happyIn60 :: (Separation) -> (HappyAbsSyn )
+happyIn60 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn60 #-}
+happyOut60 :: (HappyAbsSyn ) -> (Separation)
+happyOut60 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut60 #-}
+happyIn61 :: ([String]) -> (HappyAbsSyn )
+happyIn61 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn61 #-}
+happyOut61 :: (HappyAbsSyn ) -> ([String])
+happyOut61 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut61 #-}
+happyIn62 :: (Exp) -> (HappyAbsSyn )
+happyIn62 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn62 #-}
+happyOut62 :: (HappyAbsSyn ) -> (Exp)
+happyOut62 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut62 #-}
+happyIn63 :: (Exp) -> (HappyAbsSyn )
+happyIn63 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn63 #-}
+happyOut63 :: (HappyAbsSyn ) -> (Exp)
+happyOut63 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut63 #-}
+happyIn64 :: (Exp) -> (HappyAbsSyn )
+happyIn64 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn64 #-}
+happyOut64 :: (HappyAbsSyn ) -> (Exp)
+happyOut64 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut64 #-}
+happyIn65 :: ([Exp]) -> (HappyAbsSyn )
+happyIn65 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn65 #-}
+happyOut65 :: (HappyAbsSyn ) -> ([Exp])
+happyOut65 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut65 #-}
+happyIn66 :: ([Exp]) -> (HappyAbsSyn )
+happyIn66 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn66 #-}
+happyOut66 :: (HappyAbsSyn ) -> ([Exp])
+happyOut66 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut66 #-}
+happyIn67 :: (RHS) -> (HappyAbsSyn )
+happyIn67 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn67 #-}
+happyOut67 :: (HappyAbsSyn ) -> (RHS)
+happyOut67 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut67 #-}
+happyIn68 :: ([RHS]) -> (HappyAbsSyn )
+happyIn68 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn68 #-}
+happyOut68 :: (HappyAbsSyn ) -> ([RHS])
+happyOut68 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut68 #-}
+happyIn69 :: (MinimumSize) -> (HappyAbsSyn )
+happyIn69 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn69 #-}
+happyOut69 :: (HappyAbsSyn ) -> (MinimumSize)
+happyOut69 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut69 #-}
+happyIn70 :: (Reg) -> (HappyAbsSyn )
+happyIn70 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn70 #-}
+happyOut70 :: (HappyAbsSyn ) -> (Reg)
+happyOut70 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut70 #-}
+happyIn71 :: (Reg) -> (HappyAbsSyn )
+happyIn71 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn71 #-}
+happyOut71 :: (HappyAbsSyn ) -> (Reg)
+happyOut71 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut71 #-}
+happyIn72 :: (Reg) -> (HappyAbsSyn )
+happyIn72 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn72 #-}
+happyOut72 :: (HappyAbsSyn ) -> (Reg)
+happyOut72 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut72 #-}
+happyIn73 :: (Reg) -> (HappyAbsSyn )
+happyIn73 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn73 #-}
+happyOut73 :: (HappyAbsSyn ) -> (Reg)
+happyOut73 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut73 #-}
+happyInTok :: (Token) -> (HappyAbsSyn )
+happyInTok x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyInTok #-}
+happyOutTok :: (HappyAbsSyn ) -> (Token)
+happyOutTok x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOutTok #-}
+
+
+happyExpList :: HappyAddr
+happyExpList = HappyA# "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\xa4\x5e\xe3\x26\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x50\xaf\x71\x13\x01\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\xa9\xd7\xb8\x89\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x40\xea\x35\x6e\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x20\xf5\x1a\x37\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x80\x7a\x8d\x1b\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x0c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x28\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x14\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x50\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x01\x00\x00\xf0\x01\x00\x00\x00\x00\x00\x00\x00\x00\x08\x80\x00\x00\x00\xf8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x40\x00\x00\x00\x7c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x20\x00\x00\x00\x3e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x10\x00\x00\x00\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x09\x65\x80\x82\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x80\x84\x32\x40\x41\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x40\x42\x19\xa0\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x20\xa1\x0c\x50\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x04\x12\xca\x00\x05\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x60\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x20\xa1\x0c\x50\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x12\xca\x00\x05\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x0c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x20\x00\x00\x00\x3e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x08\x00\x00\x80\x0f\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x04\x00\x00\xc0\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x40\x00\x00\x00\x7c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x40\x01\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x80\x02\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x12\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x48\xbd\xc6\x0d\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x52\xaf\x71\x13\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\xa0\x5e\xe3\x06\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x52\xaf\x71\x13\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x40\xea\x35\x6e\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x09\x65\x80\x82\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x21\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x02\x00\x00\xe0\x03\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x01\x00\x00\xf0\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x12\xca\x00\x05\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x24\x94\x01\x0a\x02\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x12\xca\x00\x05\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x20\xa1\x0c\x50\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x80\x84\x32\x40\x41\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x28\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x01\x00\x00\xf0\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x0c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"#
+
+{-# NOINLINE happyExpListPerState #-}
+happyExpListPerState st =
+    token_strs_expected
+  where token_strs = ["error","%dummy","%start_pLGrammar","%start_pLDef","%start_pListLDef","%start_pListIdent","%start_pGrammar","%start_pListDef","%start_pDef","%start_pItem","%start_pListItem","%start_pCat","%start_pLabel","%start_pLabelId","%start_pProfItem","%start_pIntList","%start_pListInteger","%start_pListIntList","%start_pListProfItem","%start_pArg","%start_pListArg","%start_pSeparation","%start_pListString","%start_pExp","%start_pExp1","%start_pExp2","%start_pListExp","%start_pListExp2","%start_pRHS","%start_pListRHS","%start_pMinimumSize","%start_pReg2","%start_pReg1","%start_pReg3","%start_pReg","Ident","String","Integer","Char","Double","LGrammar","LDef","ListLDef","ListIdent","Grammar","ListDef","Def","Item","ListItem","Cat","Label","LabelId","ProfItem","IntList","ListInteger","ListIntList","ListProfItem","Arg","ListArg","Separation","ListString","Exp","Exp1","Exp2","ListExp","ListExp2","RHS","ListRHS","MinimumSize","Reg2","Reg1","Reg3","Reg","'('","')'","'*'","'+'","','","'-'","'.'","':'","'::='","';'","'='","'?'","'['","']'","'_'","'char'","'coercions'","'comment'","'define'","'delimiters'","'digit'","'entrypoints'","'eps'","'internal'","'layout'","'letter'","'lower'","'nonempty'","'position'","'rules'","'separator'","'stop'","'terminator'","'token'","'toplevel'","'upper'","'views'","'{'","'|'","'}'","L_ident","L_quoted","L_integ","L_charac","L_doubl","%eof"]
+        bit_start = st * 119
+        bit_end = (st + 1) * 119
+        read_bit = readArrayBit happyExpList
+        bits = map read_bit [bit_start..bit_end - 1]
+        bits_indexed = zip bits [0..118]
+        token_strs_expected = concatMap f bits_indexed
+        f (False, _) = []
+        f (True, nr) = [token_strs !! nr]
+
+happyActOffsets :: HappyAddr
+happyActOffsets = HappyA# "\x50\x00\x69\x00\x50\x00\xe7\xff\x82\x00\x82\x00\x9b\x00\xd9\x00\x00\x00\x1c\x00\x2d\x00\x2d\x00\x47\x00\x4e\x00\x59\x00\x90\x00\xb1\x00\xaf\x00\x00\x00\xa4\x01\xe0\x00\x07\x00\x07\x00\x07\x00\x07\x00\x07\x00\x00\x00\x00\x00\xc6\x00\x29\x00\x29\x00\x29\x00\x29\x00\x0f\x01\x00\x00\x00\x00\x11\x00\x15\x01\x03\x00\x19\x01\x29\x00\x13\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x13\x01\x00\x00\x3e\x00\x30\x01\x01\x00\x25\x01\x00\x00\xd9\x00\x38\x01\x3d\x01\x3d\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07\x00\x3d\x01\x07\x00\x07\x00\x00\x00\x00\x00\x00\x00\x07\x00\x61\x01\x6a\x01\x00\x00\x48\x01\x48\x01\x48\x01\x48\x01\x72\x01\x4c\x01\x4c\x01\x68\x01\x68\x01\x20\x00\x00\x00\x70\x01\xad\x01\x7d\x01\x8a\x01\xb3\x01\x85\x01\x91\x01\xc8\x01\xa0\x01\xa0\x01\xa0\x01\x00\x00\xa0\x01\xc7\x01\xc2\x01\x00\x00\xa3\x01\x4a\x00\x00\x00\xa3\x01\x1c\x00\xf6\xff\x00\x00\xa3\x01\x00\x00\xa3\x01\xcb\x01\xab\x01\xa9\x01\xac\x01\x1c\x00\xac\x01\x98\x00\xa1\x01\xb6\x01\xb0\x01\xba\x01\xba\x01\xb1\x01\xb2\x01\xcd\x01\x82\x00\xb7\x01\x00\x00\xd6\x01\xb8\x01\x05\x00\xd2\x01\xb9\x01\xd5\x01\x00\x00\x50\x00\xbb\x01\xbc\x01\xbc\x01\x00\x00\x00\x00\x00\x00\x9b\x00\x50\x00\xbf\x01\x00\x00\x82\x00\x29\x00\x1c\x00\x1c\x00\xd8\x01\xc0\x01\x00\x00\xc1\x01\x00\x00\xd7\x01\x00\x00\xc3\x01\x00\x00\xc3\x01\xc4\x01\x1c\x00\x00\x00\xd1\x01\xe1\x01\x00\x00\x78\x00\x00\x00\x45\x00\xc5\x01\xde\x01\xe4\x01\xe4\x01\x00\x00\x00\x00\x00\x00\x00\x00\xc9\x01\x07\x00\x07\x00\x00\x00\xe0\x01\xf0\x01\x00\x00\x00\x00\x03\x00\x29\x00\x00\x00\x00\x00\x00\x00\xcc\x01\xe7\x01\xf4\x01\x29\x00\x29\x00\x00\x00\x00\x00\x00\x00\x29\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xe9\x01\x00\x00\x00\x00\x00\x00\x00\x00\xea\x01\x00\x00\x00\x00\xda\x01\x00\x00\x00\x00\xfa\xff\xcf\x01\x1c\x00\x00\x00\x29\x00\x00\x00\xcf\x01\xcf\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf1\x01\xa4\x01\x07\x00\x00\x00\xf9\x01\xf7\x01\xf2\x01\x00\x00\xd9\x00\x00\x00\xe2\x01\x00\x00\xd9\x00\x00\x00\xd9\x01\xef\x01\xfe\x01\x00\x00\x00\x00"#
+
+happyGotoOffsets :: HappyAddr
+happyGotoOffsets = HappyA# "\x5d\x01\x8d\x01\x69\x01\x0b\x00\x96\x01\x99\x01\x73\x01\xaf\x01\xf5\x01\x89\x00\x8b\x01\x09\x00\xf6\x01\xf3\x01\x02\x00\xae\x01\x8d\x00\x77\x00\xec\x01\xee\x01\x37\x00\x1a\x01\x2e\x01\x4b\x01\xf2\x00\xc9\x00\x71\x00\x35\x01\xe8\x01\x3c\x00\xbc\x00\xfe\xff\xa3\x00\x00\x00\x00\x00\x00\x00\x17\x00\x00\x00\x00\x00\x00\x00\xad\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07\x02\x00\x00\x00\x00\x00\x00\x17\x00\x00\x00\x00\x00\xbe\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xe8\x00\x00\x00\x1f\x01\xf7\x00\x00\x00\x00\x00\x00\x00\xed\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x09\x02\x0a\x02\xc3\x00\x00\x00\x00\x00\xf0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x41\x01\x00\x00\x00\x00\xa9\x00\xbe\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0c\x02\x0d\x02\x0f\x02\xc0\x00\x4c\x00\xa7\x01\x52\x00\x00\x00\x10\x02\xf8\x01\xfa\x01\x11\x02\x00\x00\x00\x00\xa2\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x75\x01\xb6\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x01\x81\x01\x08\x01\x00\x00\xaa\x01\xb2\x00\x07\x01\x5c\x01\x00\x00\x12\x02\x00\x00\x57\x00\x00\x00\x00\x00\x00\x00\x13\x02\xfc\x01\x14\x02\x0b\x02\x60\x01\x00\x00\x00\x00\x22\x01\x00\x00\x00\x00\x00\x00\x00\x00\xd1\x00\x00\x00\xb4\x01\xb5\x01\x00\x00\x00\x00\x00\x00\x00\x00\x5b\x00\x24\x01\xfc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x39\x01\x00\x00\x43\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xbf\x00\x17\x00\x00\x00\x00\x00\x00\x00\x17\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc3\x00\x15\x02\x86\x01\x00\x00\xb8\x00\x3b\x01\x16\x02\x17\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x02\x29\x01\x18\x02\x00\x00\x00\x00\x00\x00\x00\x00\xbe\x01\x00\x00\xfb\x01\x19\x02\xbe\x01\x00\x00\x4e\x01\x00\x00\x00\x00\x00\x00\x00\x00"#
+
+happyAdjustOffset :: Happy_GHC_Exts.Int# -> Happy_GHC_Exts.Int#
+happyAdjustOffset off = off
+
+happyDefActions :: HappyAddr
+happyDefActions = HappyA# "\xd5\xff\x00\x00\xd5\xff\x00\x00\xce\xff\xce\xff\x00\x00\x00\x00\xb8\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa9\xff\xa6\xff\x00\x00\x00\x00\xa0\xff\x9e\xff\x00\x00\x00\x00\x00\x00\x00\x00\x8e\xff\x00\x00\xb8\xff\xb8\xff\x85\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xde\xff\x7b\xff\x80\xff\x72\xff\x83\xff\x00\x00\x00\x00\x00\x00\x74\xff\x78\xff\x7c\xff\x77\xff\x75\xff\x76\xff\x00\x00\xdb\xff\x00\x00\x00\x00\x00\x00\x00\x00\x86\xff\x89\xff\x88\xff\x00\x00\x00\x00\x95\xff\x92\xff\x94\xff\x93\xff\x91\xff\x8b\xff\x00\x00\x00\x00\x8e\xff\xdd\xff\xdc\xff\xda\xff\x95\xff\x8d\xff\x98\xff\x96\xff\x00\x00\x00\x00\x00\x00\x00\x00\x9b\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa1\xff\x00\x00\xa3\xff\x00\x00\x00\x00\xa5\xff\x00\x00\xa9\xff\xa8\xff\x00\x00\x00\x00\x00\x00\xb0\xff\x00\x00\x00\x00\x00\x00\xaf\xff\x00\x00\xb4\xff\xb5\xff\x00\x00\x00\x00\x00\x00\xba\xff\x00\x00\xb9\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x85\xff\x85\xff\x00\x00\x00\x00\xcd\xff\xce\xff\x00\x00\xcf\xff\xd1\xff\x00\x00\xb0\xff\xd4\xff\x00\x00\x00\x00\xd8\xff\xd5\xff\x00\x00\x00\x00\x00\x00\xd9\xff\xd6\xff\xd2\xff\x00\x00\xd5\xff\x00\x00\xcb\xff\xce\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xbd\xff\x00\x00\xbb\xff\x00\x00\xc4\xff\x00\x00\xa0\xff\xc9\xff\x00\x00\x00\x00\xb7\xff\x00\x00\xb1\xff\xb3\xff\x00\x00\xae\xff\x00\x00\xa9\xff\x00\x00\xa6\xff\xa6\xff\xa2\xff\x9f\xff\x9d\xff\x9c\xff\x00\x00\x00\x00\x8e\xff\x97\xff\x00\x00\x00\x00\x8a\xff\xb8\xff\x84\xff\x00\x00\x7f\xff\x7e\xff\x7d\xff\x00\x00\x00\x00\x00\x00\x00\x00\x81\xff\x73\xff\x7a\xff\x79\xff\x82\xff\x87\xff\x8f\xff\x90\xff\x8c\xff\x99\xff\x9a\xff\x00\x00\xa4\xff\xaa\xff\xa7\xff\xad\xff\x00\x00\xb2\xff\xb6\xff\x00\x00\xc0\xff\xc8\xff\x00\x00\x00\x00\x00\x00\xbc\xff\x00\x00\xb8\xff\x00\x00\x00\x00\xc6\xff\xcc\xff\xd0\xff\xd3\xff\xd7\xff\xc2\xff\xc3\xff\xbf\xff\xc5\xff\x00\x00\x9e\xff\x00\x00\xb8\xff\x00\x00\x00\x00\x00\x00\xac\xff\xca\xff\xbe\xff\x85\xff\xb8\xff\xc7\xff\xc1\xff\xa9\xff\x00\x00\x00\x00\xab\xff"#
+
+happyCheck :: HappyAddr
+happyCheck = HappyA# "\xff\xff\x03\x00\x01\x00\x0d\x00\x02\x00\x0b\x00\x03\x00\x04\x00\x01\x00\x00\x00\x05\x00\x00\x00\x02\x00\x08\x00\x0d\x00\x0c\x00\x29\x00\x10\x00\x01\x00\x08\x00\x0d\x00\x13\x00\x15\x00\x06\x00\x17\x00\x10\x00\x03\x00\x1a\x00\x1b\x00\x13\x00\x0d\x00\x29\x00\x2a\x00\x10\x00\x24\x00\x29\x00\x2e\x00\x24\x00\x15\x00\x26\x00\x17\x00\x0d\x00\x01\x00\x1a\x00\x1b\x00\x2c\x00\x01\x00\x2e\x00\x29\x00\x2a\x00\x2b\x00\x2c\x00\x2d\x00\x24\x00\x0d\x00\x26\x00\x01\x00\x10\x00\x0d\x00\x24\x00\x0f\x00\x2c\x00\x15\x00\x03\x00\x17\x00\x03\x00\x04\x00\x1a\x00\x1b\x00\x29\x00\x03\x00\x02\x00\x01\x00\x29\x00\x0c\x00\x01\x00\x00\x00\x24\x00\x2e\x00\x26\x00\x19\x00\x01\x00\x0d\x00\x01\x00\x08\x00\x2c\x00\x29\x00\x0d\x00\x01\x00\x0f\x00\x0a\x00\x0d\x00\x01\x00\x0d\x00\x22\x00\x0f\x00\x24\x00\x11\x00\x12\x00\x13\x00\x14\x00\x22\x00\x16\x00\x24\x00\x18\x00\x19\x00\x01\x00\x19\x00\x2e\x00\x1d\x00\x1e\x00\x1f\x00\x19\x00\x21\x00\x22\x00\x29\x00\x19\x00\x25\x00\x0d\x00\x00\x00\x0f\x00\x29\x00\x11\x00\x12\x00\x13\x00\x14\x00\x0d\x00\x16\x00\x08\x00\x18\x00\x19\x00\x01\x00\x2b\x00\x0d\x00\x1d\x00\x1e\x00\x1f\x00\x00\x00\x21\x00\x22\x00\x0a\x00\x16\x00\x25\x00\x0d\x00\x1f\x00\x0f\x00\x29\x00\x11\x00\x12\x00\x13\x00\x14\x00\x0e\x00\x16\x00\x01\x00\x18\x00\x19\x00\x01\x00\x0d\x00\x11\x00\x1d\x00\x1e\x00\x1f\x00\x15\x00\x21\x00\x22\x00\x0d\x00\x03\x00\x0f\x00\x0d\x00\x00\x00\x0f\x00\x29\x00\x11\x00\x12\x00\x13\x00\x14\x00\x03\x00\x16\x00\x01\x00\x18\x00\x19\x00\x03\x00\x00\x00\x0e\x00\x1d\x00\x1e\x00\x1f\x00\x03\x00\x21\x00\x22\x00\x08\x00\x03\x00\x00\x00\x29\x00\x03\x00\x00\x00\x29\x00\x22\x00\x23\x00\x24\x00\x25\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x0e\x00\x22\x00\x23\x00\x24\x00\x25\x00\x02\x00\x22\x00\x23\x00\x24\x00\x25\x00\x29\x00\x16\x00\x22\x00\x23\x00\x24\x00\x25\x00\x22\x00\x23\x00\x24\x00\x22\x00\x1c\x00\x24\x00\x13\x00\x1c\x00\x0d\x00\x1e\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x11\x00\x29\x00\x2a\x00\x1c\x00\x15\x00\x1e\x00\x00\x00\x00\x00\x1c\x00\x2a\x00\x1e\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x08\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x0e\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x11\x00\x1a\x00\x1b\x00\x1c\x00\x15\x00\x29\x00\x1a\x00\x1b\x00\x1c\x00\x27\x00\x2a\x00\x1a\x00\x1b\x00\x1c\x00\x00\x00\x0d\x00\x1a\x00\x1b\x00\x1c\x00\x0d\x00\x2e\x00\x0d\x00\x1b\x00\x1c\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x02\x00\x10\x00\x11\x00\x2e\x00\x1f\x00\x20\x00\x15\x00\x27\x00\x1f\x00\x20\x00\x1f\x00\x20\x00\x00\x00\x00\x00\x2e\x00\x27\x00\x00\x00\x13\x00\x05\x00\x06\x00\x07\x00\x08\x00\x05\x00\x1c\x00\x0b\x00\x00\x00\x0e\x00\x2e\x00\x0f\x00\x10\x00\x0e\x00\x06\x00\x07\x00\x08\x00\x08\x00\x00\x00\x0b\x00\x00\x00\x2e\x00\x05\x00\x0f\x00\x10\x00\x2e\x00\x06\x00\x07\x00\x08\x00\x0b\x00\x00\x00\x0b\x00\x00\x00\x0f\x00\x10\x00\x0f\x00\x10\x00\x00\x00\x06\x00\x07\x00\x08\x00\x0b\x00\x00\x00\x0b\x00\x00\x00\x0f\x00\x10\x00\x0f\x00\x10\x00\x2a\x00\x06\x00\x0e\x00\x08\x00\x00\x00\x0d\x00\x0b\x00\x00\x00\x0f\x00\x10\x00\x0f\x00\x10\x00\x2e\x00\x09\x00\x0a\x00\x0b\x00\x00\x00\x0a\x00\x0b\x00\x0f\x00\x10\x00\x00\x00\x0f\x00\x10\x00\x00\x00\x2e\x00\x0a\x00\x0b\x00\x01\x00\x00\x00\x01\x00\x0f\x00\x10\x00\x2e\x00\x0a\x00\x0b\x00\x0f\x00\x10\x00\x05\x00\x0f\x00\x10\x00\x0c\x00\x2b\x00\x0e\x00\x00\x00\x01\x00\x12\x00\x20\x00\x14\x00\x1f\x00\x23\x00\x21\x00\x12\x00\x12\x00\x14\x00\x14\x00\x0c\x00\x2a\x00\x0e\x00\x05\x00\x2e\x00\x08\x00\x0e\x00\x2e\x00\x07\x00\x2a\x00\x29\x00\x29\x00\x1c\x00\x0a\x00\x22\x00\x29\x00\x29\x00\x05\x00\x0a\x00\x08\x00\x07\x00\x0e\x00\x2e\x00\x09\x00\x01\x00\x09\x00\x29\x00\x2e\x00\x2e\x00\x2e\x00\x29\x00\x29\x00\x2e\x00\x2a\x00\x0e\x00\x2a\x00\x0e\x00\x2b\x00\x2b\x00\x0d\x00\x02\x00\x2a\x00\x28\x00\x0e\x00\x02\x00\x0e\x00\x0e\x00\x2a\x00\x09\x00\x02\x00\x05\x00\x0e\x00\x1c\x00\x0d\x00\x02\x00\x01\x00\x0d\x00\x17\x00\x2b\x00\x12\x00\x18\x00\x11\x00\x01\x00\x21\x00\x01\x00\x01\x00\x00\x00\x02\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x17\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x21\x00\x18\x00\x21\x00\x21\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x0d\x00\x0d\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"#
+
+happyTable :: HappyAddr
+happyTable = HappyA# "\x00\x00\x23\x00\x29\x00\x6b\x00\x5d\x00\xee\x00\xbe\x00\xbf\x00\x43\x00\x61\x00\x93\x00\x82\x00\x5d\x00\xd1\xff\x2a\x00\xc0\x00\x23\x00\x2b\x00\x29\x00\x83\x00\x44\x00\x5e\x00\x2c\x00\xc4\x00\x2d\x00\x62\x00\x23\x00\x2e\x00\x2f\x00\xac\x00\x2a\x00\x23\x00\x45\x00\x2b\x00\x32\x00\x23\x00\xff\xff\x30\x00\x2c\x00\x31\x00\x2d\x00\x6b\x00\x29\x00\x2e\x00\x2f\x00\x32\x00\x64\x00\xff\xff\x23\x00\x45\x00\x46\x00\x32\x00\x47\x00\x30\x00\x2a\x00\x31\x00\x4f\x00\x2b\x00\x65\x00\xbb\x00\x66\x00\x32\x00\x2c\x00\x23\x00\x2d\x00\xbe\x00\xbf\x00\x2e\x00\x2f\x00\x23\x00\x23\x00\xd4\x00\x5a\x00\x23\x00\xc0\x00\xa9\x00\x82\x00\x30\x00\xff\xff\x31\x00\x50\x00\x64\x00\xd5\x00\x4f\x00\x9e\x00\x32\x00\x23\x00\x65\x00\x4f\x00\x66\x00\x8a\x00\x5d\x00\x4f\x00\x65\x00\x34\x00\x66\x00\x26\x00\x72\x00\x73\x00\x74\x00\x75\x00\xc8\x00\x76\x00\x26\x00\x77\x00\x78\x00\x64\x00\x9a\x00\xff\xff\x79\x00\x7a\x00\x7b\x00\xdd\x00\x7c\x00\x7d\x00\x23\x00\xce\x00\x8b\x00\x65\x00\x55\x00\x66\x00\x23\x00\x72\x00\x73\x00\x74\x00\x75\x00\x37\x00\x76\x00\xab\x00\x77\x00\x78\x00\x64\x00\x46\x00\xaf\x00\x79\x00\x7a\x00\x7b\x00\x68\x00\x7c\x00\x7d\x00\x80\x00\x56\x00\x8b\x00\x65\x00\x3a\x00\x66\x00\x23\x00\x72\x00\x73\x00\x74\x00\x75\x00\x69\x00\x76\x00\x64\x00\x77\x00\x78\x00\x64\x00\x5d\x00\x57\x00\x79\x00\x7a\x00\x7b\x00\x58\x00\x7c\x00\x7d\x00\x65\x00\x23\x00\x66\x00\x65\x00\x68\x00\x66\x00\x23\x00\x72\x00\x73\x00\x74\x00\x75\x00\x23\x00\x76\x00\x5a\x00\x77\x00\x78\x00\x23\x00\x82\x00\xa5\x00\x79\x00\x7a\x00\x7b\x00\x23\x00\x7c\x00\x7d\x00\x8e\x00\x23\x00\x68\x00\x23\x00\x23\x00\x55\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x3b\x00\x3c\x00\x3d\x00\x3e\x00\x3f\x00\x9f\x00\x24\x00\x25\x00\x26\x00\xc2\x00\x5d\x00\x24\x00\x25\x00\x26\x00\xe2\x00\x23\x00\xb0\x00\x24\x00\x25\x00\x26\x00\xea\x00\x24\x00\x33\x00\x26\x00\xc4\x00\x37\x00\x26\x00\xd2\x00\x40\x00\x6b\x00\x41\x00\x3b\x00\x3c\x00\x3d\x00\x3e\x00\x3f\x00\x3b\x00\x3c\x00\x3d\x00\x3e\x00\x3f\x00\x47\x00\x3c\x00\x3d\x00\x3e\x00\x3f\x00\x47\x00\x3c\x00\x3d\x00\x3e\x00\x3f\x00\x47\x00\x3c\x00\x3d\x00\x3e\x00\x3f\x00\x57\x00\x23\x00\x45\x00\x40\x00\xaf\x00\xb9\x00\x68\x00\x82\x00\x40\x00\x45\x00\xb6\x00\x48\x00\x49\x00\x4a\x00\x4b\x00\xe4\x00\x48\x00\x49\x00\x4a\x00\xb7\x00\xe1\x00\x48\x00\x49\x00\x4a\x00\xcc\x00\x47\x00\x3c\x00\x3d\x00\x3e\x00\x3f\x00\x47\x00\x3c\x00\x3d\x00\x3e\x00\x3f\x00\x47\x00\x3c\x00\x3d\x00\x3e\x00\x3f\x00\x47\x00\x3c\x00\x3d\x00\x3e\x00\x3f\x00\x47\x00\x3c\x00\x3d\x00\x3e\x00\x3f\x00\x57\x00\x4e\x00\x49\x00\x4a\x00\xd5\x00\x23\x00\xb8\x00\x49\x00\x4a\x00\xbd\x00\x45\x00\xcd\x00\x49\x00\x4a\x00\x61\x00\x37\x00\xf4\x00\x49\x00\x4a\x00\x37\x00\xff\xff\x37\x00\x4d\x00\x4a\x00\x3b\x00\x3c\x00\x3d\x00\x3e\x00\x3f\x00\x5d\x00\xa6\x00\x57\x00\xff\xff\x38\x00\x39\x00\xa7\x00\xbd\x00\x38\x00\xc9\x00\x38\x00\xe9\x00\x68\x00\x84\x00\xff\xff\xbb\x00\x68\x00\xfa\x00\x8c\x00\x85\x00\x8d\x00\x87\x00\xb6\x00\x4c\x00\x88\x00\x84\x00\xe0\x00\xff\xff\x70\x00\x67\x00\xd7\x00\x85\x00\x86\x00\x87\x00\xb5\x00\x61\x00\x88\x00\x84\x00\xff\xff\xb4\x00\x70\x00\x67\x00\xff\xff\x85\x00\x8f\x00\x87\x00\x6f\x00\x61\x00\x88\x00\x84\x00\x70\x00\x67\x00\x70\x00\x67\x00\x68\x00\x85\x00\xe5\x00\x87\x00\xe6\x00\x61\x00\x88\x00\x84\x00\x70\x00\x67\x00\x70\x00\x67\x00\x45\x00\x8b\x00\xeb\x00\x87\x00\x61\x00\xaf\x00\x88\x00\x61\x00\x66\x00\x67\x00\x70\x00\x67\x00\xff\xff\x80\x00\x81\x00\x7e\x00\x61\x00\x7d\x00\x7e\x00\x70\x00\x67\x00\x61\x00\x70\x00\x67\x00\x61\x00\xff\xff\x93\x00\x7e\x00\x5a\x00\x68\x00\x6c\x00\x70\x00\x67\x00\xff\xff\xe3\x00\x7e\x00\x9d\x00\x67\x00\xae\x00\x70\x00\x67\x00\x6d\x00\x46\x00\x6e\x00\x68\x00\x6c\x00\x5a\x00\x9c\x00\x5b\x00\x53\x00\x9d\x00\x54\x00\x5a\x00\x5a\x00\xd0\x00\xcf\x00\xa4\x00\x45\x00\x6e\x00\xac\x00\xff\xff\xab\x00\xaa\x00\xff\xff\xa4\x00\x45\x00\x23\x00\x23\x00\x37\x00\x95\x00\x9a\x00\x23\x00\x23\x00\x93\x00\x92\x00\x91\x00\xdd\x00\xd7\x00\xff\xff\xe0\x00\x5a\x00\xef\x00\x23\x00\xff\xff\xff\xff\xff\xff\x23\x00\x23\x00\xff\xff\x45\x00\xd2\x00\x45\x00\xcc\x00\x46\x00\x46\x00\x5d\x00\xcb\x00\x45\x00\xc8\x00\xc7\x00\xc6\x00\xf1\x00\xf0\x00\x45\x00\xf7\x00\xf3\x00\xf2\x00\xfc\x00\x37\x00\xfa\x00\xfd\x00\xc1\x00\x6b\x00\x54\x00\x46\x00\x5f\x00\x51\x00\x60\x00\xc0\x00\x35\x00\xb2\x00\xb1\x00\xa2\x00\xd8\x00\xa1\x00\xa0\x00\x98\x00\x95\x00\xde\x00\xda\x00\xdb\x00\xd9\x00\xec\x00\xe8\x00\xe7\x00\x97\x00\xf5\x00\x96\x00\xf8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf3\x00\xf7\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"#
+
+happyReduceArr = Happy_Data_Array.array (33, 141) [
+	(33 , happyReduce_33),
+	(34 , happyReduce_34),
+	(35 , happyReduce_35),
+	(36 , happyReduce_36),
+	(37 , happyReduce_37),
+	(38 , happyReduce_38),
+	(39 , happyReduce_39),
+	(40 , happyReduce_40),
+	(41 , happyReduce_41),
+	(42 , happyReduce_42),
+	(43 , happyReduce_43),
+	(44 , happyReduce_44),
+	(45 , happyReduce_45),
+	(46 , happyReduce_46),
+	(47 , happyReduce_47),
+	(48 , happyReduce_48),
+	(49 , happyReduce_49),
+	(50 , happyReduce_50),
+	(51 , happyReduce_51),
+	(52 , happyReduce_52),
+	(53 , happyReduce_53),
+	(54 , happyReduce_54),
+	(55 , happyReduce_55),
+	(56 , happyReduce_56),
+	(57 , happyReduce_57),
+	(58 , happyReduce_58),
+	(59 , happyReduce_59),
+	(60 , happyReduce_60),
+	(61 , happyReduce_61),
+	(62 , happyReduce_62),
+	(63 , happyReduce_63),
+	(64 , happyReduce_64),
+	(65 , happyReduce_65),
+	(66 , happyReduce_66),
+	(67 , happyReduce_67),
+	(68 , happyReduce_68),
+	(69 , happyReduce_69),
+	(70 , happyReduce_70),
+	(71 , happyReduce_71),
+	(72 , happyReduce_72),
+	(73 , happyReduce_73),
+	(74 , happyReduce_74),
+	(75 , happyReduce_75),
+	(76 , happyReduce_76),
+	(77 , happyReduce_77),
+	(78 , happyReduce_78),
+	(79 , happyReduce_79),
+	(80 , happyReduce_80),
+	(81 , happyReduce_81),
+	(82 , happyReduce_82),
+	(83 , happyReduce_83),
+	(84 , happyReduce_84),
+	(85 , happyReduce_85),
+	(86 , happyReduce_86),
+	(87 , happyReduce_87),
+	(88 , happyReduce_88),
+	(89 , happyReduce_89),
+	(90 , happyReduce_90),
+	(91 , happyReduce_91),
+	(92 , happyReduce_92),
+	(93 , happyReduce_93),
+	(94 , happyReduce_94),
+	(95 , happyReduce_95),
+	(96 , happyReduce_96),
+	(97 , happyReduce_97),
+	(98 , happyReduce_98),
+	(99 , happyReduce_99),
+	(100 , happyReduce_100),
+	(101 , happyReduce_101),
+	(102 , happyReduce_102),
+	(103 , happyReduce_103),
+	(104 , happyReduce_104),
+	(105 , happyReduce_105),
+	(106 , happyReduce_106),
+	(107 , happyReduce_107),
+	(108 , happyReduce_108),
+	(109 , happyReduce_109),
+	(110 , happyReduce_110),
+	(111 , happyReduce_111),
+	(112 , happyReduce_112),
+	(113 , happyReduce_113),
+	(114 , happyReduce_114),
+	(115 , happyReduce_115),
+	(116 , happyReduce_116),
+	(117 , happyReduce_117),
+	(118 , happyReduce_118),
+	(119 , happyReduce_119),
+	(120 , happyReduce_120),
+	(121 , happyReduce_121),
+	(122 , happyReduce_122),
+	(123 , happyReduce_123),
+	(124 , happyReduce_124),
+	(125 , happyReduce_125),
+	(126 , happyReduce_126),
+	(127 , happyReduce_127),
+	(128 , happyReduce_128),
+	(129 , happyReduce_129),
+	(130 , happyReduce_130),
+	(131 , happyReduce_131),
+	(132 , happyReduce_132),
+	(133 , happyReduce_133),
+	(134 , happyReduce_134),
+	(135 , happyReduce_135),
+	(136 , happyReduce_136),
+	(137 , happyReduce_137),
+	(138 , happyReduce_138),
+	(139 , happyReduce_139),
+	(140 , happyReduce_140),
+	(141 , happyReduce_141)
+	]
+
+happy_n_terms = 47 :: Int
+happy_n_nonterms = 38 :: Int
+
+happyReduce_33 = happySpecReduce_1  0# happyReduction_33
+happyReduction_33 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (PT _ (TV happy_var_1)) -> 
+	happyIn36
+		 (Ident happy_var_1
+	)}
+
+happyReduce_34 = happySpecReduce_1  1# happyReduction_34
+happyReduction_34 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (PT _ (TL happy_var_1)) -> 
+	happyIn37
+		 (happy_var_1
+	)}
+
+happyReduce_35 = happySpecReduce_1  2# happyReduction_35
+happyReduction_35 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (PT _ (TI happy_var_1)) -> 
+	happyIn38
+		 ((read ( happy_var_1)) :: Integer
+	)}
+
+happyReduce_36 = happySpecReduce_1  3# happyReduction_36
+happyReduction_36 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (PT _ (TC happy_var_1)) -> 
+	happyIn39
+		 ((read ( happy_var_1)) :: Char
+	)}
+
+happyReduce_37 = happySpecReduce_1  4# happyReduction_37
+happyReduction_37 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (PT _ (TD happy_var_1)) -> 
+	happyIn40
+		 ((read ( happy_var_1)) :: Double
+	)}
+
+happyReduce_38 = happySpecReduce_1  5# happyReduction_38
+happyReduction_38 happy_x_1
+	 =  case happyOut43 happy_x_1 of { happy_var_1 -> 
+	happyIn41
+		 (AbsBNF.LGr happy_var_1
+	)}
+
+happyReduce_39 = happySpecReduce_1  6# happyReduction_39
+happyReduction_39 happy_x_1
+	 =  case happyOut47 happy_x_1 of { happy_var_1 -> 
+	happyIn42
+		 (AbsBNF.DefAll happy_var_1
+	)}
+
+happyReduce_40 = happySpecReduce_3  6# happyReduction_40
+happyReduction_40 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut44 happy_x_1 of { happy_var_1 -> 
+	case happyOut47 happy_x_3 of { happy_var_3 -> 
+	happyIn42
+		 (AbsBNF.DefSome happy_var_1 happy_var_3
+	)}}
+
+happyReduce_41 = happySpecReduce_2  6# happyReduction_41
+happyReduction_41 happy_x_2
+	happy_x_1
+	 =  case happyOut44 happy_x_2 of { happy_var_2 -> 
+	happyIn42
+		 (AbsBNF.LDefView happy_var_2
+	)}
+
+happyReduce_42 = happySpecReduce_0  7# happyReduction_42
+happyReduction_42  =  happyIn43
+		 ([]
+	)
+
+happyReduce_43 = happySpecReduce_1  7# happyReduction_43
+happyReduction_43 happy_x_1
+	 =  case happyOut42 happy_x_1 of { happy_var_1 -> 
+	happyIn43
+		 ((:[]) happy_var_1
+	)}
+
+happyReduce_44 = happySpecReduce_3  7# happyReduction_44
+happyReduction_44 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut42 happy_x_1 of { happy_var_1 -> 
+	case happyOut43 happy_x_3 of { happy_var_3 -> 
+	happyIn43
+		 ((:) happy_var_1 happy_var_3
+	)}}
+
+happyReduce_45 = happySpecReduce_2  7# happyReduction_45
+happyReduction_45 happy_x_2
+	happy_x_1
+	 =  case happyOut43 happy_x_2 of { happy_var_2 -> 
+	happyIn43
+		 (happy_var_2
+	)}
+
+happyReduce_46 = happySpecReduce_1  8# happyReduction_46
+happyReduction_46 happy_x_1
+	 =  case happyOut36 happy_x_1 of { happy_var_1 -> 
+	happyIn44
+		 ((:[]) happy_var_1
+	)}
+
+happyReduce_47 = happySpecReduce_3  8# happyReduction_47
+happyReduction_47 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut36 happy_x_1 of { happy_var_1 -> 
+	case happyOut44 happy_x_3 of { happy_var_3 -> 
+	happyIn44
+		 ((:) happy_var_1 happy_var_3
+	)}}
+
+happyReduce_48 = happySpecReduce_1  9# happyReduction_48
+happyReduction_48 happy_x_1
+	 =  case happyOut46 happy_x_1 of { happy_var_1 -> 
+	happyIn45
+		 (AbsBNF.Grammar happy_var_1
+	)}
+
+happyReduce_49 = happySpecReduce_0  10# happyReduction_49
+happyReduction_49  =  happyIn46
+		 ([]
+	)
+
+happyReduce_50 = happySpecReduce_1  10# happyReduction_50
+happyReduction_50 happy_x_1
+	 =  case happyOut47 happy_x_1 of { happy_var_1 -> 
+	happyIn46
+		 ((:[]) happy_var_1
+	)}
+
+happyReduce_51 = happySpecReduce_3  10# happyReduction_51
+happyReduction_51 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut47 happy_x_1 of { happy_var_1 -> 
+	case happyOut46 happy_x_3 of { happy_var_3 -> 
+	happyIn46
+		 ((:) happy_var_1 happy_var_3
+	)}}
+
+happyReduce_52 = happySpecReduce_2  10# happyReduction_52
+happyReduction_52 happy_x_2
+	happy_x_1
+	 =  case happyOut46 happy_x_2 of { happy_var_2 -> 
+	happyIn46
+		 (happy_var_2
+	)}
+
+happyReduce_53 = happyReduce 5# 11# happyReduction_53
+happyReduction_53 (happy_x_5 `HappyStk`
+	happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOut51 happy_x_1 of { happy_var_1 -> 
+	case happyOut50 happy_x_3 of { happy_var_3 -> 
+	case happyOut49 happy_x_5 of { happy_var_5 -> 
+	happyIn47
+		 (AbsBNF.Rule happy_var_1 happy_var_3 (reverse happy_var_5)
+	) `HappyStk` happyRest}}}
+
+happyReduce_54 = happySpecReduce_2  11# happyReduction_54
+happyReduction_54 happy_x_2
+	happy_x_1
+	 =  case happyOut37 happy_x_2 of { happy_var_2 -> 
+	happyIn47
+		 (AbsBNF.Comment happy_var_2
+	)}
+
+happyReduce_55 = happySpecReduce_3  11# happyReduction_55
+happyReduction_55 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut37 happy_x_2 of { happy_var_2 -> 
+	case happyOut37 happy_x_3 of { happy_var_3 -> 
+	happyIn47
+		 (AbsBNF.Comments happy_var_2 happy_var_3
+	)}}
+
+happyReduce_56 = happyReduce 6# 11# happyReduction_56
+happyReduction_56 (happy_x_6 `HappyStk`
+	happy_x_5 `HappyStk`
+	happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOut51 happy_x_2 of { happy_var_2 -> 
+	case happyOut50 happy_x_4 of { happy_var_4 -> 
+	case happyOut49 happy_x_6 of { happy_var_6 -> 
+	happyIn47
+		 (AbsBNF.Internal happy_var_2 happy_var_4 (reverse happy_var_6)
+	) `HappyStk` happyRest}}}
+
+happyReduce_57 = happySpecReduce_3  11# happyReduction_57
+happyReduction_57 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut36 happy_x_2 of { happy_var_2 -> 
+	case happyOut73 happy_x_3 of { happy_var_3 -> 
+	happyIn47
+		 (AbsBNF.Token happy_var_2 happy_var_3
+	)}}
+
+happyReduce_58 = happyReduce 4# 11# happyReduction_58
+happyReduction_58 (happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOut36 happy_x_3 of { happy_var_3 -> 
+	case happyOut73 happy_x_4 of { happy_var_4 -> 
+	happyIn47
+		 (AbsBNF.PosToken happy_var_3 happy_var_4
+	) `HappyStk` happyRest}}
+
+happyReduce_59 = happySpecReduce_2  11# happyReduction_59
+happyReduction_59 happy_x_2
+	happy_x_1
+	 =  case happyOut44 happy_x_2 of { happy_var_2 -> 
+	happyIn47
+		 (AbsBNF.Entryp happy_var_2
+	)}
+
+happyReduce_60 = happyReduce 4# 11# happyReduction_60
+happyReduction_60 (happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOut69 happy_x_2 of { happy_var_2 -> 
+	case happyOut50 happy_x_3 of { happy_var_3 -> 
+	case happyOut37 happy_x_4 of { happy_var_4 -> 
+	happyIn47
+		 (AbsBNF.Separator happy_var_2 happy_var_3 happy_var_4
+	) `HappyStk` happyRest}}}
+
+happyReduce_61 = happyReduce 4# 11# happyReduction_61
+happyReduction_61 (happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOut69 happy_x_2 of { happy_var_2 -> 
+	case happyOut50 happy_x_3 of { happy_var_3 -> 
+	case happyOut37 happy_x_4 of { happy_var_4 -> 
+	happyIn47
+		 (AbsBNF.Terminator happy_var_2 happy_var_3 happy_var_4
+	) `HappyStk` happyRest}}}
+
+happyReduce_62 = happyReduce 6# 11# happyReduction_62
+happyReduction_62 (happy_x_6 `HappyStk`
+	happy_x_5 `HappyStk`
+	happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOut50 happy_x_2 of { happy_var_2 -> 
+	case happyOut37 happy_x_3 of { happy_var_3 -> 
+	case happyOut37 happy_x_4 of { happy_var_4 -> 
+	case happyOut60 happy_x_5 of { happy_var_5 -> 
+	case happyOut69 happy_x_6 of { happy_var_6 -> 
+	happyIn47
+		 (AbsBNF.Delimiters happy_var_2 happy_var_3 happy_var_4 happy_var_5 happy_var_6
+	) `HappyStk` happyRest}}}}}
+
+happyReduce_63 = happySpecReduce_3  11# happyReduction_63
+happyReduction_63 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut36 happy_x_2 of { happy_var_2 -> 
+	case happyOut38 happy_x_3 of { happy_var_3 -> 
+	happyIn47
+		 (AbsBNF.Coercions happy_var_2 happy_var_3
+	)}}
+
+happyReduce_64 = happyReduce 4# 11# happyReduction_64
+happyReduction_64 (happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOut36 happy_x_2 of { happy_var_2 -> 
+	case happyOut68 happy_x_4 of { happy_var_4 -> 
+	happyIn47
+		 (AbsBNF.Rules happy_var_2 happy_var_4
+	) `HappyStk` happyRest}}
+
+happyReduce_65 = happyReduce 5# 11# happyReduction_65
+happyReduction_65 (happy_x_5 `HappyStk`
+	happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOut36 happy_x_2 of { happy_var_2 -> 
+	case happyOut59 happy_x_3 of { happy_var_3 -> 
+	case happyOut62 happy_x_5 of { happy_var_5 -> 
+	happyIn47
+		 (AbsBNF.Function happy_var_2 (reverse happy_var_3) happy_var_5
+	) `HappyStk` happyRest}}}
+
+happyReduce_66 = happySpecReduce_2  11# happyReduction_66
+happyReduction_66 happy_x_2
+	happy_x_1
+	 =  case happyOut61 happy_x_2 of { happy_var_2 -> 
+	happyIn47
+		 (AbsBNF.Layout happy_var_2
+	)}
+
+happyReduce_67 = happySpecReduce_3  11# happyReduction_67
+happyReduction_67 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut61 happy_x_3 of { happy_var_3 -> 
+	happyIn47
+		 (AbsBNF.LayoutStop happy_var_3
+	)}
+
+happyReduce_68 = happySpecReduce_2  11# happyReduction_68
+happyReduction_68 happy_x_2
+	happy_x_1
+	 =  happyIn47
+		 (AbsBNF.LayoutTop
+	)
+
+happyReduce_69 = happySpecReduce_1  12# happyReduction_69
+happyReduction_69 happy_x_1
+	 =  case happyOut37 happy_x_1 of { happy_var_1 -> 
+	happyIn48
+		 (AbsBNF.Terminal happy_var_1
+	)}
+
+happyReduce_70 = happySpecReduce_1  12# happyReduction_70
+happyReduction_70 happy_x_1
+	 =  case happyOut50 happy_x_1 of { happy_var_1 -> 
+	happyIn48
+		 (AbsBNF.NTerminal happy_var_1
+	)}
+
+happyReduce_71 = happySpecReduce_0  13# happyReduction_71
+happyReduction_71  =  happyIn49
+		 ([]
+	)
+
+happyReduce_72 = happySpecReduce_2  13# happyReduction_72
+happyReduction_72 happy_x_2
+	happy_x_1
+	 =  case happyOut49 happy_x_1 of { happy_var_1 -> 
+	case happyOut48 happy_x_2 of { happy_var_2 -> 
+	happyIn49
+		 (flip (:) happy_var_1 happy_var_2
+	)}}
+
+happyReduce_73 = happySpecReduce_3  14# happyReduction_73
+happyReduction_73 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut50 happy_x_2 of { happy_var_2 -> 
+	happyIn50
+		 (AbsBNF.ListCat happy_var_2
+	)}
+
+happyReduce_74 = happySpecReduce_1  14# happyReduction_74
+happyReduction_74 happy_x_1
+	 =  case happyOut36 happy_x_1 of { happy_var_1 -> 
+	happyIn50
+		 (AbsBNF.IdCat happy_var_1
+	)}
+
+happyReduce_75 = happySpecReduce_1  15# happyReduction_75
+happyReduction_75 happy_x_1
+	 =  case happyOut52 happy_x_1 of { happy_var_1 -> 
+	happyIn51
+		 (AbsBNF.LabNoP happy_var_1
+	)}
+
+happyReduce_76 = happySpecReduce_2  15# happyReduction_76
+happyReduction_76 happy_x_2
+	happy_x_1
+	 =  case happyOut52 happy_x_1 of { happy_var_1 -> 
+	case happyOut57 happy_x_2 of { happy_var_2 -> 
+	happyIn51
+		 (AbsBNF.LabP happy_var_1 happy_var_2
+	)}}
+
+happyReduce_77 = happySpecReduce_3  15# happyReduction_77
+happyReduction_77 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut52 happy_x_1 of { happy_var_1 -> 
+	case happyOut52 happy_x_2 of { happy_var_2 -> 
+	case happyOut57 happy_x_3 of { happy_var_3 -> 
+	happyIn51
+		 (AbsBNF.LabPF happy_var_1 happy_var_2 happy_var_3
+	)}}}
+
+happyReduce_78 = happySpecReduce_2  15# happyReduction_78
+happyReduction_78 happy_x_2
+	happy_x_1
+	 =  case happyOut52 happy_x_1 of { happy_var_1 -> 
+	case happyOut52 happy_x_2 of { happy_var_2 -> 
+	happyIn51
+		 (AbsBNF.LabF happy_var_1 happy_var_2
+	)}}
+
+happyReduce_79 = happySpecReduce_1  16# happyReduction_79
+happyReduction_79 happy_x_1
+	 =  case happyOut36 happy_x_1 of { happy_var_1 -> 
+	happyIn52
+		 (AbsBNF.Id happy_var_1
+	)}
+
+happyReduce_80 = happySpecReduce_1  16# happyReduction_80
+happyReduction_80 happy_x_1
+	 =  happyIn52
+		 (AbsBNF.Wild
+	)
+
+happyReduce_81 = happySpecReduce_2  16# happyReduction_81
+happyReduction_81 happy_x_2
+	happy_x_1
+	 =  happyIn52
+		 (AbsBNF.ListE
+	)
+
+happyReduce_82 = happySpecReduce_3  16# happyReduction_82
+happyReduction_82 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  happyIn52
+		 (AbsBNF.ListCons
+	)
+
+happyReduce_83 = happyReduce 5# 16# happyReduction_83
+happyReduction_83 (happy_x_5 `HappyStk`
+	happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = happyIn52
+		 (AbsBNF.ListOne
+	) `HappyStk` happyRest
+
+happyReduce_84 = happyReduce 9# 17# happyReduction_84
+happyReduction_84 (happy_x_9 `HappyStk`
+	happy_x_8 `HappyStk`
+	happy_x_7 `HappyStk`
+	happy_x_6 `HappyStk`
+	happy_x_5 `HappyStk`
+	happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOut56 happy_x_3 of { happy_var_3 -> 
+	case happyOut55 happy_x_7 of { happy_var_7 -> 
+	happyIn53
+		 (AbsBNF.ProfIt happy_var_3 happy_var_7
+	) `HappyStk` happyRest}}
+
+happyReduce_85 = happySpecReduce_3  18# happyReduction_85
+happyReduction_85 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut55 happy_x_2 of { happy_var_2 -> 
+	happyIn54
+		 (AbsBNF.Ints happy_var_2
+	)}
+
+happyReduce_86 = happySpecReduce_0  19# happyReduction_86
+happyReduction_86  =  happyIn55
+		 ([]
+	)
+
+happyReduce_87 = happySpecReduce_1  19# happyReduction_87
+happyReduction_87 happy_x_1
+	 =  case happyOut38 happy_x_1 of { happy_var_1 -> 
+	happyIn55
+		 ((:[]) happy_var_1
+	)}
+
+happyReduce_88 = happySpecReduce_3  19# happyReduction_88
+happyReduction_88 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut38 happy_x_1 of { happy_var_1 -> 
+	case happyOut55 happy_x_3 of { happy_var_3 -> 
+	happyIn55
+		 ((:) happy_var_1 happy_var_3
+	)}}
+
+happyReduce_89 = happySpecReduce_0  20# happyReduction_89
+happyReduction_89  =  happyIn56
+		 ([]
+	)
+
+happyReduce_90 = happySpecReduce_1  20# happyReduction_90
+happyReduction_90 happy_x_1
+	 =  case happyOut54 happy_x_1 of { happy_var_1 -> 
+	happyIn56
+		 ((:[]) happy_var_1
+	)}
+
+happyReduce_91 = happySpecReduce_3  20# happyReduction_91
+happyReduction_91 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut54 happy_x_1 of { happy_var_1 -> 
+	case happyOut56 happy_x_3 of { happy_var_3 -> 
+	happyIn56
+		 ((:) happy_var_1 happy_var_3
+	)}}
+
+happyReduce_92 = happySpecReduce_1  21# happyReduction_92
+happyReduction_92 happy_x_1
+	 =  case happyOut53 happy_x_1 of { happy_var_1 -> 
+	happyIn57
+		 ((:[]) happy_var_1
+	)}
+
+happyReduce_93 = happySpecReduce_2  21# happyReduction_93
+happyReduction_93 happy_x_2
+	happy_x_1
+	 =  case happyOut53 happy_x_1 of { happy_var_1 -> 
+	case happyOut57 happy_x_2 of { happy_var_2 -> 
+	happyIn57
+		 ((:) happy_var_1 happy_var_2
+	)}}
+
+happyReduce_94 = happySpecReduce_1  22# happyReduction_94
+happyReduction_94 happy_x_1
+	 =  case happyOut36 happy_x_1 of { happy_var_1 -> 
+	happyIn58
+		 (AbsBNF.Arg happy_var_1
+	)}
+
+happyReduce_95 = happySpecReduce_0  23# happyReduction_95
+happyReduction_95  =  happyIn59
+		 ([]
+	)
+
+happyReduce_96 = happySpecReduce_2  23# happyReduction_96
+happyReduction_96 happy_x_2
+	happy_x_1
+	 =  case happyOut59 happy_x_1 of { happy_var_1 -> 
+	case happyOut58 happy_x_2 of { happy_var_2 -> 
+	happyIn59
+		 (flip (:) happy_var_1 happy_var_2
+	)}}
+
+happyReduce_97 = happySpecReduce_0  24# happyReduction_97
+happyReduction_97  =  happyIn60
+		 (AbsBNF.SepNone
+	)
+
+happyReduce_98 = happySpecReduce_2  24# happyReduction_98
+happyReduction_98 happy_x_2
+	happy_x_1
+	 =  case happyOut37 happy_x_2 of { happy_var_2 -> 
+	happyIn60
+		 (AbsBNF.SepTerm happy_var_2
+	)}
+
+happyReduce_99 = happySpecReduce_2  24# happyReduction_99
+happyReduction_99 happy_x_2
+	happy_x_1
+	 =  case happyOut37 happy_x_2 of { happy_var_2 -> 
+	happyIn60
+		 (AbsBNF.SepSepar happy_var_2
+	)}
+
+happyReduce_100 = happySpecReduce_1  25# happyReduction_100
+happyReduction_100 happy_x_1
+	 =  case happyOut37 happy_x_1 of { happy_var_1 -> 
+	happyIn61
+		 ((:[]) happy_var_1
+	)}
+
+happyReduce_101 = happySpecReduce_3  25# happyReduction_101
+happyReduction_101 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut37 happy_x_1 of { happy_var_1 -> 
+	case happyOut61 happy_x_3 of { happy_var_3 -> 
+	happyIn61
+		 ((:) happy_var_1 happy_var_3
+	)}}
+
+happyReduce_102 = happySpecReduce_3  26# happyReduction_102
+happyReduction_102 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut63 happy_x_1 of { happy_var_1 -> 
+	case happyOut62 happy_x_3 of { happy_var_3 -> 
+	happyIn62
+		 (AbsBNF.Cons happy_var_1 happy_var_3
+	)}}
+
+happyReduce_103 = happySpecReduce_1  26# happyReduction_103
+happyReduction_103 happy_x_1
+	 =  case happyOut63 happy_x_1 of { happy_var_1 -> 
+	happyIn62
+		 (happy_var_1
+	)}
+
+happyReduce_104 = happySpecReduce_2  27# happyReduction_104
+happyReduction_104 happy_x_2
+	happy_x_1
+	 =  case happyOut36 happy_x_1 of { happy_var_1 -> 
+	case happyOut66 happy_x_2 of { happy_var_2 -> 
+	happyIn63
+		 (AbsBNF.App happy_var_1 happy_var_2
+	)}}
+
+happyReduce_105 = happySpecReduce_1  27# happyReduction_105
+happyReduction_105 happy_x_1
+	 =  case happyOut64 happy_x_1 of { happy_var_1 -> 
+	happyIn63
+		 (happy_var_1
+	)}
+
+happyReduce_106 = happySpecReduce_1  28# happyReduction_106
+happyReduction_106 happy_x_1
+	 =  case happyOut36 happy_x_1 of { happy_var_1 -> 
+	happyIn64
+		 (AbsBNF.Var happy_var_1
+	)}
+
+happyReduce_107 = happySpecReduce_1  28# happyReduction_107
+happyReduction_107 happy_x_1
+	 =  case happyOut38 happy_x_1 of { happy_var_1 -> 
+	happyIn64
+		 (AbsBNF.LitInt happy_var_1
+	)}
+
+happyReduce_108 = happySpecReduce_1  28# happyReduction_108
+happyReduction_108 happy_x_1
+	 =  case happyOut39 happy_x_1 of { happy_var_1 -> 
+	happyIn64
+		 (AbsBNF.LitChar happy_var_1
+	)}
+
+happyReduce_109 = happySpecReduce_1  28# happyReduction_109
+happyReduction_109 happy_x_1
+	 =  case happyOut37 happy_x_1 of { happy_var_1 -> 
+	happyIn64
+		 (AbsBNF.LitString happy_var_1
+	)}
+
+happyReduce_110 = happySpecReduce_1  28# happyReduction_110
+happyReduction_110 happy_x_1
+	 =  case happyOut40 happy_x_1 of { happy_var_1 -> 
+	happyIn64
+		 (AbsBNF.LitDouble happy_var_1
+	)}
+
+happyReduce_111 = happySpecReduce_3  28# happyReduction_111
+happyReduction_111 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut65 happy_x_2 of { happy_var_2 -> 
+	happyIn64
+		 (AbsBNF.List happy_var_2
+	)}
+
+happyReduce_112 = happySpecReduce_3  28# happyReduction_112
+happyReduction_112 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut62 happy_x_2 of { happy_var_2 -> 
+	happyIn64
+		 (happy_var_2
+	)}
+
+happyReduce_113 = happySpecReduce_0  29# happyReduction_113
+happyReduction_113  =  happyIn65
+		 ([]
+	)
+
+happyReduce_114 = happySpecReduce_1  29# happyReduction_114
+happyReduction_114 happy_x_1
+	 =  case happyOut62 happy_x_1 of { happy_var_1 -> 
+	happyIn65
+		 ((:[]) happy_var_1
+	)}
+
+happyReduce_115 = happySpecReduce_3  29# happyReduction_115
+happyReduction_115 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut62 happy_x_1 of { happy_var_1 -> 
+	case happyOut65 happy_x_3 of { happy_var_3 -> 
+	happyIn65
+		 ((:) happy_var_1 happy_var_3
+	)}}
+
+happyReduce_116 = happySpecReduce_1  30# happyReduction_116
+happyReduction_116 happy_x_1
+	 =  case happyOut64 happy_x_1 of { happy_var_1 -> 
+	happyIn66
+		 ((:[]) happy_var_1
+	)}
+
+happyReduce_117 = happySpecReduce_2  30# happyReduction_117
+happyReduction_117 happy_x_2
+	happy_x_1
+	 =  case happyOut64 happy_x_1 of { happy_var_1 -> 
+	case happyOut66 happy_x_2 of { happy_var_2 -> 
+	happyIn66
+		 ((:) happy_var_1 happy_var_2
+	)}}
+
+happyReduce_118 = happySpecReduce_1  31# happyReduction_118
+happyReduction_118 happy_x_1
+	 =  case happyOut49 happy_x_1 of { happy_var_1 -> 
+	happyIn67
+		 (AbsBNF.RHS (reverse happy_var_1)
+	)}
+
+happyReduce_119 = happySpecReduce_1  32# happyReduction_119
+happyReduction_119 happy_x_1
+	 =  case happyOut67 happy_x_1 of { happy_var_1 -> 
+	happyIn68
+		 ((:[]) happy_var_1
+	)}
+
+happyReduce_120 = happySpecReduce_3  32# happyReduction_120
+happyReduction_120 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut67 happy_x_1 of { happy_var_1 -> 
+	case happyOut68 happy_x_3 of { happy_var_3 -> 
+	happyIn68
+		 ((:) happy_var_1 happy_var_3
+	)}}
+
+happyReduce_121 = happySpecReduce_1  33# happyReduction_121
+happyReduction_121 happy_x_1
+	 =  happyIn69
+		 (AbsBNF.MNonempty
+	)
+
+happyReduce_122 = happySpecReduce_0  33# happyReduction_122
+happyReduction_122  =  happyIn69
+		 (AbsBNF.MEmpty
+	)
+
+happyReduce_123 = happySpecReduce_2  34# happyReduction_123
+happyReduction_123 happy_x_2
+	happy_x_1
+	 =  case happyOut70 happy_x_1 of { happy_var_1 -> 
+	case happyOut72 happy_x_2 of { happy_var_2 -> 
+	happyIn70
+		 (AbsBNF.RSeq happy_var_1 happy_var_2
+	)}}
+
+happyReduce_124 = happySpecReduce_1  34# happyReduction_124
+happyReduction_124 happy_x_1
+	 =  case happyOut72 happy_x_1 of { happy_var_1 -> 
+	happyIn70
+		 (happy_var_1
+	)}
+
+happyReduce_125 = happySpecReduce_3  35# happyReduction_125
+happyReduction_125 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut71 happy_x_1 of { happy_var_1 -> 
+	case happyOut70 happy_x_3 of { happy_var_3 -> 
+	happyIn71
+		 (AbsBNF.RAlt happy_var_1 happy_var_3
+	)}}
+
+happyReduce_126 = happySpecReduce_3  35# happyReduction_126
+happyReduction_126 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut70 happy_x_1 of { happy_var_1 -> 
+	case happyOut70 happy_x_3 of { happy_var_3 -> 
+	happyIn71
+		 (AbsBNF.RMinus happy_var_1 happy_var_3
+	)}}
+
+happyReduce_127 = happySpecReduce_1  35# happyReduction_127
+happyReduction_127 happy_x_1
+	 =  case happyOut70 happy_x_1 of { happy_var_1 -> 
+	happyIn71
+		 (happy_var_1
+	)}
+
+happyReduce_128 = happySpecReduce_2  36# happyReduction_128
+happyReduction_128 happy_x_2
+	happy_x_1
+	 =  case happyOut72 happy_x_1 of { happy_var_1 -> 
+	happyIn72
+		 (AbsBNF.RStar happy_var_1
+	)}
+
+happyReduce_129 = happySpecReduce_2  36# happyReduction_129
+happyReduction_129 happy_x_2
+	happy_x_1
+	 =  case happyOut72 happy_x_1 of { happy_var_1 -> 
+	happyIn72
+		 (AbsBNF.RPlus happy_var_1
+	)}
+
+happyReduce_130 = happySpecReduce_2  36# happyReduction_130
+happyReduction_130 happy_x_2
+	happy_x_1
+	 =  case happyOut72 happy_x_1 of { happy_var_1 -> 
+	happyIn72
+		 (AbsBNF.ROpt happy_var_1
+	)}
+
+happyReduce_131 = happySpecReduce_1  36# happyReduction_131
+happyReduction_131 happy_x_1
+	 =  happyIn72
+		 (AbsBNF.REps
+	)
+
+happyReduce_132 = happySpecReduce_1  36# happyReduction_132
+happyReduction_132 happy_x_1
+	 =  case happyOut39 happy_x_1 of { happy_var_1 -> 
+	happyIn72
+		 (AbsBNF.RChar happy_var_1
+	)}
+
+happyReduce_133 = happySpecReduce_3  36# happyReduction_133
+happyReduction_133 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut37 happy_x_2 of { happy_var_2 -> 
+	happyIn72
+		 (AbsBNF.RAlts happy_var_2
+	)}
+
+happyReduce_134 = happySpecReduce_3  36# happyReduction_134
+happyReduction_134 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut37 happy_x_2 of { happy_var_2 -> 
+	happyIn72
+		 (AbsBNF.RSeqs happy_var_2
+	)}
+
+happyReduce_135 = happySpecReduce_1  36# happyReduction_135
+happyReduction_135 happy_x_1
+	 =  happyIn72
+		 (AbsBNF.RDigit
+	)
+
+happyReduce_136 = happySpecReduce_1  36# happyReduction_136
+happyReduction_136 happy_x_1
+	 =  happyIn72
+		 (AbsBNF.RLetter
+	)
+
+happyReduce_137 = happySpecReduce_1  36# happyReduction_137
+happyReduction_137 happy_x_1
+	 =  happyIn72
+		 (AbsBNF.RUpper
+	)
+
+happyReduce_138 = happySpecReduce_1  36# happyReduction_138
+happyReduction_138 happy_x_1
+	 =  happyIn72
+		 (AbsBNF.RLower
+	)
+
+happyReduce_139 = happySpecReduce_1  36# happyReduction_139
+happyReduction_139 happy_x_1
+	 =  happyIn72
+		 (AbsBNF.RAny
+	)
+
+happyReduce_140 = happySpecReduce_3  36# happyReduction_140
+happyReduction_140 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut73 happy_x_2 of { happy_var_2 -> 
+	happyIn72
+		 (happy_var_2
+	)}
+
+happyReduce_141 = happySpecReduce_1  37# happyReduction_141
+happyReduction_141 happy_x_1
+	 =  case happyOut71 happy_x_1 of { happy_var_1 -> 
+	happyIn73
+		 (happy_var_1
+	)}
+
+happyNewToken action sts stk [] =
+	happyDoAction 46# notHappyAtAll action sts stk []
+
+happyNewToken action sts stk (tk:tks) =
+	let cont i = happyDoAction i tk action sts stk tks in
+	case tk of {
+	PT _ (TS _ 1) -> cont 1#;
+	PT _ (TS _ 2) -> cont 2#;
+	PT _ (TS _ 3) -> cont 3#;
+	PT _ (TS _ 4) -> cont 4#;
+	PT _ (TS _ 5) -> cont 5#;
+	PT _ (TS _ 6) -> cont 6#;
+	PT _ (TS _ 7) -> cont 7#;
+	PT _ (TS _ 8) -> cont 8#;
+	PT _ (TS _ 9) -> cont 9#;
+	PT _ (TS _ 10) -> cont 10#;
+	PT _ (TS _ 11) -> cont 11#;
+	PT _ (TS _ 12) -> cont 12#;
+	PT _ (TS _ 13) -> cont 13#;
+	PT _ (TS _ 14) -> cont 14#;
+	PT _ (TS _ 15) -> cont 15#;
+	PT _ (TS _ 16) -> cont 16#;
+	PT _ (TS _ 17) -> cont 17#;
+	PT _ (TS _ 18) -> cont 18#;
+	PT _ (TS _ 19) -> cont 19#;
+	PT _ (TS _ 20) -> cont 20#;
+	PT _ (TS _ 21) -> cont 21#;
+	PT _ (TS _ 22) -> cont 22#;
+	PT _ (TS _ 23) -> cont 23#;
+	PT _ (TS _ 24) -> cont 24#;
+	PT _ (TS _ 25) -> cont 25#;
+	PT _ (TS _ 26) -> cont 26#;
+	PT _ (TS _ 27) -> cont 27#;
+	PT _ (TS _ 28) -> cont 28#;
+	PT _ (TS _ 29) -> cont 29#;
+	PT _ (TS _ 30) -> cont 30#;
+	PT _ (TS _ 31) -> cont 31#;
+	PT _ (TS _ 32) -> cont 32#;
+	PT _ (TS _ 33) -> cont 33#;
+	PT _ (TS _ 34) -> cont 34#;
+	PT _ (TS _ 35) -> cont 35#;
+	PT _ (TS _ 36) -> cont 36#;
+	PT _ (TS _ 37) -> cont 37#;
+	PT _ (TS _ 38) -> cont 38#;
+	PT _ (TS _ 39) -> cont 39#;
+	PT _ (TS _ 40) -> cont 40#;
+	PT _ (TV happy_dollar_dollar) -> cont 41#;
+	PT _ (TL happy_dollar_dollar) -> cont 42#;
+	PT _ (TI happy_dollar_dollar) -> cont 43#;
+	PT _ (TC happy_dollar_dollar) -> cont 44#;
+	PT _ (TD happy_dollar_dollar) -> cont 45#;
+	_ -> happyError' ((tk:tks), [])
+	}
+
+happyError_ explist 46# tk tks = happyError' (tks, explist)
+happyError_ explist _ tk tks = happyError' ((tk:tks), explist)
+
+happyThen :: () => Err a -> (a -> Err b) -> Err b
+happyThen = (thenM)
+happyReturn :: () => a -> Err a
+happyReturn = (returnM)
+happyThen1 m k tks = (thenM) m (\a -> k a tks)
+happyReturn1 :: () => a -> b -> Err a
+happyReturn1 = \a tks -> (returnM) a
+happyError' :: () => ([(Token)], [String]) -> Err a
+happyError' = (\(tokens, _) -> happyError tokens)
+pLGrammar tks = happySomeParser where
+ happySomeParser = happyThen (happyParse 0# tks) (\x -> happyReturn (happyOut41 x))
+
+pLDef tks = happySomeParser where
+ happySomeParser = happyThen (happyParse 1# tks) (\x -> happyReturn (happyOut42 x))
+
+pListLDef tks = happySomeParser where
+ happySomeParser = happyThen (happyParse 2# tks) (\x -> happyReturn (happyOut43 x))
+
+pListIdent tks = happySomeParser where
+ happySomeParser = happyThen (happyParse 3# tks) (\x -> happyReturn (happyOut44 x))
+
+pGrammar tks = happySomeParser where
+ happySomeParser = happyThen (happyParse 4# tks) (\x -> happyReturn (happyOut45 x))
+
+pListDef tks = happySomeParser where
+ happySomeParser = happyThen (happyParse 5# tks) (\x -> happyReturn (happyOut46 x))
+
+pDef tks = happySomeParser where
+ happySomeParser = happyThen (happyParse 6# tks) (\x -> happyReturn (happyOut47 x))
+
+pItem tks = happySomeParser where
+ happySomeParser = happyThen (happyParse 7# tks) (\x -> happyReturn (happyOut48 x))
+
+pListItem tks = happySomeParser where
+ happySomeParser = happyThen (happyParse 8# tks) (\x -> happyReturn (happyOut49 x))
+
+pCat tks = happySomeParser where
+ happySomeParser = happyThen (happyParse 9# tks) (\x -> happyReturn (happyOut50 x))
+
+pLabel tks = happySomeParser where
+ happySomeParser = happyThen (happyParse 10# tks) (\x -> happyReturn (happyOut51 x))
+
+pLabelId tks = happySomeParser where
+ happySomeParser = happyThen (happyParse 11# tks) (\x -> happyReturn (happyOut52 x))
+
+pProfItem tks = happySomeParser where
+ happySomeParser = happyThen (happyParse 12# tks) (\x -> happyReturn (happyOut53 x))
+
+pIntList tks = happySomeParser where
+ happySomeParser = happyThen (happyParse 13# tks) (\x -> happyReturn (happyOut54 x))
+
+pListInteger tks = happySomeParser where
+ happySomeParser = happyThen (happyParse 14# tks) (\x -> happyReturn (happyOut55 x))
+
+pListIntList tks = happySomeParser where
+ happySomeParser = happyThen (happyParse 15# tks) (\x -> happyReturn (happyOut56 x))
+
+pListProfItem tks = happySomeParser where
+ happySomeParser = happyThen (happyParse 16# tks) (\x -> happyReturn (happyOut57 x))
+
+pArg tks = happySomeParser where
+ happySomeParser = happyThen (happyParse 17# tks) (\x -> happyReturn (happyOut58 x))
+
+pListArg tks = happySomeParser where
+ happySomeParser = happyThen (happyParse 18# tks) (\x -> happyReturn (happyOut59 x))
+
+pSeparation tks = happySomeParser where
+ happySomeParser = happyThen (happyParse 19# tks) (\x -> happyReturn (happyOut60 x))
+
+pListString tks = happySomeParser where
+ happySomeParser = happyThen (happyParse 20# tks) (\x -> happyReturn (happyOut61 x))
+
+pExp tks = happySomeParser where
+ happySomeParser = happyThen (happyParse 21# tks) (\x -> happyReturn (happyOut62 x))
+
+pExp1 tks = happySomeParser where
+ happySomeParser = happyThen (happyParse 22# tks) (\x -> happyReturn (happyOut63 x))
+
+pExp2 tks = happySomeParser where
+ happySomeParser = happyThen (happyParse 23# tks) (\x -> happyReturn (happyOut64 x))
+
+pListExp tks = happySomeParser where
+ happySomeParser = happyThen (happyParse 24# tks) (\x -> happyReturn (happyOut65 x))
+
+pListExp2 tks = happySomeParser where
+ happySomeParser = happyThen (happyParse 25# tks) (\x -> happyReturn (happyOut66 x))
+
+pRHS tks = happySomeParser where
+ happySomeParser = happyThen (happyParse 26# tks) (\x -> happyReturn (happyOut67 x))
+
+pListRHS tks = happySomeParser where
+ happySomeParser = happyThen (happyParse 27# tks) (\x -> happyReturn (happyOut68 x))
+
+pMinimumSize tks = happySomeParser where
+ happySomeParser = happyThen (happyParse 28# tks) (\x -> happyReturn (happyOut69 x))
+
+pReg2 tks = happySomeParser where
+ happySomeParser = happyThen (happyParse 29# tks) (\x -> happyReturn (happyOut70 x))
+
+pReg1 tks = happySomeParser where
+ happySomeParser = happyThen (happyParse 30# tks) (\x -> happyReturn (happyOut71 x))
+
+pReg3 tks = happySomeParser where
+ happySomeParser = happyThen (happyParse 31# tks) (\x -> happyReturn (happyOut72 x))
+
+pReg tks = happySomeParser where
+ happySomeParser = happyThen (happyParse 32# tks) (\x -> happyReturn (happyOut73 x))
+
+happySeq = happyDontSeq
+
+
+returnM :: a -> Err a
+returnM = return
+
+thenM :: Err a -> (a -> Err b) -> Err b
+thenM = (>>=)
+
+happyError :: [Token] -> Err a
+happyError ts =
+  Bad $ "syntax error at " ++ tokenPos ts ++ 
+  case ts of
+    [] -> []
+    [Err _] -> " due to lexer error"
+    t:_ -> " before `" ++ id(prToken t) ++ "'"
+
+myLexer = tokens
+{-# LINE 1 "templates/GenericTemplate.hs" #-}
+{-# LINE 1 "templates/GenericTemplate.hs" #-}
+{-# LINE 1 "<built-in>" #-}
+{-# LINE 18 "<built-in>" #-}
+{-# LINE 1 "/usr/local/lib/ghc-8.2.1/include/ghcversion.h" #-}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{-# LINE 19 "<built-in>" #-}
+{-# LINE 1 "/var/folders/lg/qcd3v89j59l3m6520kr42bdm0000gn/T/ghc7892_0/ghc_2.h" #-}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{-# LINE 20 "<built-in>" #-}
+{-# LINE 1 "templates/GenericTemplate.hs" #-}
+-- Id: GenericTemplate.hs,v 1.26 2005/01/14 14:47:22 simonmar Exp 
+
+
+
+
+
+
+
+
+
+
+
+
+
+-- Do not remove this comment. Required to fix CPP parsing when using GCC and a clang-compiled alex.
+#if __GLASGOW_HASKELL__ > 706
+#define LT(n,m) ((Happy_GHC_Exts.tagToEnum# (n Happy_GHC_Exts.<# m)) :: Bool)
+#define GTE(n,m) ((Happy_GHC_Exts.tagToEnum# (n Happy_GHC_Exts.>=# m)) :: Bool)
+#define EQ(n,m) ((Happy_GHC_Exts.tagToEnum# (n Happy_GHC_Exts.==# m)) :: Bool)
+#else
+#define LT(n,m) (n Happy_GHC_Exts.<# m)
+#define GTE(n,m) (n Happy_GHC_Exts.>=# m)
+#define EQ(n,m) (n Happy_GHC_Exts.==# m)
+#endif
+
+{-# LINE 43 "templates/GenericTemplate.hs" #-}
+
+data Happy_IntList = HappyCons Happy_GHC_Exts.Int# Happy_IntList
+
+
+
+
+
+
+
+
+{-# LINE 65 "templates/GenericTemplate.hs" #-}
+
+
+{-# LINE 75 "templates/GenericTemplate.hs" #-}
+
+
+
+
+
+
+
+
+
+
+infixr 9 `HappyStk`
+data HappyStk a = HappyStk a (HappyStk a)
+
+-----------------------------------------------------------------------------
+-- starting the parse
+
+happyParse start_state = happyNewToken start_state notHappyAtAll notHappyAtAll
+
+-----------------------------------------------------------------------------
+-- Accepting the parse
+
+-- If the current token is 0#, it means we've just accepted a partial
+-- parse (a %partial parser).  We must ignore the saved token on the top of
+-- the stack in this case.
+happyAccept 0# tk st sts (_ `HappyStk` ans `HappyStk` _) =
+        happyReturn1 ans
+happyAccept j tk st sts (HappyStk ans _) = 
+        (happyTcHack j (happyTcHack st)) (happyReturn1 ans)
+
+-----------------------------------------------------------------------------
+-- Arrays only: do the next action
+
+
+
+happyDoAction i tk st
+        = {- nothing -}
+          
+
+          case action of
+                0#           -> {- nothing -}
+                                     happyFail (happyExpListPerState ((Happy_GHC_Exts.I# (st)) :: Int)) i tk st
+                -1#          -> {- nothing -}
+                                     happyAccept i tk st
+                n | LT(n,(0# :: Happy_GHC_Exts.Int#)) -> {- nothing -}
+                                                   
+                                                   (happyReduceArr Happy_Data_Array.! rule) i tk st
+                                                   where rule = (Happy_GHC_Exts.I# ((Happy_GHC_Exts.negateInt# ((n Happy_GHC_Exts.+# (1# :: Happy_GHC_Exts.Int#))))))
+                n                 -> {- nothing -}
+                                     
+
+                                     happyShift new_state i tk st
+                                     where new_state = (n Happy_GHC_Exts.-# (1# :: Happy_GHC_Exts.Int#))
+   where off    = happyAdjustOffset (indexShortOffAddr happyActOffsets st)
+         off_i  = (off Happy_GHC_Exts.+#  i)
+         check  = if GTE(off_i,(0# :: Happy_GHC_Exts.Int#))
+                  then EQ(indexShortOffAddr happyCheck off_i, i)
+                  else False
+         action
+          | check     = indexShortOffAddr happyTable off_i
+          | otherwise = indexShortOffAddr happyDefActions st
+
+
+
+
+indexShortOffAddr (HappyA# arr) off =
+        Happy_GHC_Exts.narrow16Int# i
+  where
+        i = Happy_GHC_Exts.word2Int# (Happy_GHC_Exts.or# (Happy_GHC_Exts.uncheckedShiftL# high 8#) low)
+        high = Happy_GHC_Exts.int2Word# (Happy_GHC_Exts.ord# (Happy_GHC_Exts.indexCharOffAddr# arr (off' Happy_GHC_Exts.+# 1#)))
+        low  = Happy_GHC_Exts.int2Word# (Happy_GHC_Exts.ord# (Happy_GHC_Exts.indexCharOffAddr# arr off'))
+        off' = off Happy_GHC_Exts.*# 2#
+
+
+
+
+{-# INLINE happyLt #-}
+happyLt x y = LT(x,y)
+
+
+readArrayBit arr bit =
+    Bits.testBit (Happy_GHC_Exts.I# (indexShortOffAddr arr ((unbox_int bit) `Happy_GHC_Exts.iShiftRA#` 4#))) (bit `mod` 16)
+  where unbox_int (Happy_GHC_Exts.I# x) = x
+
+
+
+
+
+
+data HappyAddr = HappyA# Happy_GHC_Exts.Addr#
+
+
+-----------------------------------------------------------------------------
+-- HappyState data type (not arrays)
+
+
+{-# LINE 180 "templates/GenericTemplate.hs" #-}
+
+-----------------------------------------------------------------------------
+-- Shifting a token
+
+happyShift new_state 0# tk st sts stk@(x `HappyStk` _) =
+     let i = (case Happy_GHC_Exts.unsafeCoerce# x of { (Happy_GHC_Exts.I# (i)) -> i }) in
+--     trace "shifting the error token" $
+     happyDoAction i tk new_state (HappyCons (st) (sts)) (stk)
+
+happyShift new_state i tk st sts stk =
+     happyNewToken new_state (HappyCons (st) (sts)) ((happyInTok (tk))`HappyStk`stk)
+
+-- happyReduce is specialised for the common cases.
+
+happySpecReduce_0 i fn 0# tk st sts stk
+     = happyFail [] 0# tk st sts stk
+happySpecReduce_0 nt fn j tk st@((action)) sts stk
+     = happyGoto nt j tk st (HappyCons (st) (sts)) (fn `HappyStk` stk)
+
+happySpecReduce_1 i fn 0# tk st sts stk
+     = happyFail [] 0# tk st sts stk
+happySpecReduce_1 nt fn j tk _ sts@((HappyCons (st@(action)) (_))) (v1`HappyStk`stk')
+     = let r = fn v1 in
+       happySeq r (happyGoto nt j tk st sts (r `HappyStk` stk'))
+
+happySpecReduce_2 i fn 0# tk st sts stk
+     = happyFail [] 0# tk st sts stk
+happySpecReduce_2 nt fn j tk _ (HappyCons (_) (sts@((HappyCons (st@(action)) (_))))) (v1`HappyStk`v2`HappyStk`stk')
+     = let r = fn v1 v2 in
+       happySeq r (happyGoto nt j tk st sts (r `HappyStk` stk'))
+
+happySpecReduce_3 i fn 0# tk st sts stk
+     = happyFail [] 0# tk st sts stk
+happySpecReduce_3 nt fn j tk _ (HappyCons (_) ((HappyCons (_) (sts@((HappyCons (st@(action)) (_))))))) (v1`HappyStk`v2`HappyStk`v3`HappyStk`stk')
+     = let r = fn v1 v2 v3 in
+       happySeq r (happyGoto nt j tk st sts (r `HappyStk` stk'))
+
+happyReduce k i fn 0# tk st sts stk
+     = happyFail [] 0# tk st sts stk
+happyReduce k nt fn j tk st sts stk
+     = case happyDrop (k Happy_GHC_Exts.-# (1# :: Happy_GHC_Exts.Int#)) sts of
+         sts1@((HappyCons (st1@(action)) (_))) ->
+                let r = fn stk in  -- it doesn't hurt to always seq here...
+                happyDoSeq r (happyGoto nt j tk st1 sts1 r)
+
+happyMonadReduce k nt fn 0# tk st sts stk
+     = happyFail [] 0# tk st sts stk
+happyMonadReduce k nt fn j tk st sts stk =
+      case happyDrop k (HappyCons (st) (sts)) of
+        sts1@((HappyCons (st1@(action)) (_))) ->
+          let drop_stk = happyDropStk k stk in
+          happyThen1 (fn stk tk) (\r -> happyGoto nt j tk st1 sts1 (r `HappyStk` drop_stk))
+
+happyMonad2Reduce k nt fn 0# tk st sts stk
+     = happyFail [] 0# tk st sts stk
+happyMonad2Reduce k nt fn j tk st sts stk =
+      case happyDrop k (HappyCons (st) (sts)) of
+        sts1@((HappyCons (st1@(action)) (_))) ->
+         let drop_stk = happyDropStk k stk
+
+             off = happyAdjustOffset (indexShortOffAddr happyGotoOffsets st1)
+             off_i = (off Happy_GHC_Exts.+#  nt)
+             new_state = indexShortOffAddr happyTable off_i
+
+
+
+
+          in
+          happyThen1 (fn stk tk) (\r -> happyNewToken new_state sts1 (r `HappyStk` drop_stk))
+
+happyDrop 0# l = l
+happyDrop n (HappyCons (_) (t)) = happyDrop (n Happy_GHC_Exts.-# (1# :: Happy_GHC_Exts.Int#)) t
+
+happyDropStk 0# l = l
+happyDropStk n (x `HappyStk` xs) = happyDropStk (n Happy_GHC_Exts.-# (1#::Happy_GHC_Exts.Int#)) xs
+
+-----------------------------------------------------------------------------
+-- Moving to a new state after a reduction
+
+
+happyGoto nt j tk st = 
+   {- nothing -}
+   happyDoAction j tk new_state
+   where off = happyAdjustOffset (indexShortOffAddr happyGotoOffsets st)
+         off_i = (off Happy_GHC_Exts.+#  nt)
+         new_state = indexShortOffAddr happyTable off_i
+
+
+
+
+-----------------------------------------------------------------------------
+-- Error recovery (0# is the error token)
+
+-- parse error if we are in recovery and we fail again
+happyFail explist 0# tk old_st _ stk@(x `HappyStk` _) =
+     let i = (case Happy_GHC_Exts.unsafeCoerce# x of { (Happy_GHC_Exts.I# (i)) -> i }) in
+--      trace "failing" $ 
+        happyError_ explist i tk
+
+{-  We don't need state discarding for our restricted implementation of
+    "error".  In fact, it can cause some bogus parses, so I've disabled it
+    for now --SDM
+
+-- discard a state
+happyFail  0# tk old_st (HappyCons ((action)) (sts)) 
+                                                (saved_tok `HappyStk` _ `HappyStk` stk) =
+--      trace ("discarding state, depth " ++ show (length stk))  $
+        happyDoAction 0# tk action sts ((saved_tok`HappyStk`stk))
+-}
+
+-- Enter error recovery: generate an error token,
+--                       save the old token and carry on.
+happyFail explist i tk (action) sts stk =
+--      trace "entering error recovery" $
+        happyDoAction 0# tk action sts ( (Happy_GHC_Exts.unsafeCoerce# (Happy_GHC_Exts.I# (i))) `HappyStk` stk)
+
+-- Internal happy errors:
+
+notHappyAtAll :: a
+notHappyAtAll = error "Internal Happy error\n"
+
+-----------------------------------------------------------------------------
+-- Hack to get the typechecker to accept our action functions
+
+
+happyTcHack :: Happy_GHC_Exts.Int# -> a -> a
+happyTcHack x y = y
+{-# INLINE happyTcHack #-}
+
+
+-----------------------------------------------------------------------------
+-- Seq-ing.  If the --strict flag is given, then Happy emits 
+--      happySeq = happyDoSeq
+-- otherwise it emits
+--      happySeq = happyDontSeq
+
+happyDoSeq, happyDontSeq :: a -> b -> b
+happyDoSeq   a b = a `seq` b
+happyDontSeq a b = b
+
+-----------------------------------------------------------------------------
+-- Don't inline any functions from the template.  GHC has a nasty habit
+-- of deciding to inline happyGoto everywhere, which increases the size of
+-- the generated parser quite a bit.
+
+
+{-# NOINLINE happyDoAction #-}
+{-# NOINLINE happyTable #-}
+{-# NOINLINE happyCheck #-}
+{-# NOINLINE happyActOffsets #-}
+{-# NOINLINE happyGotoOffsets #-}
+{-# NOINLINE happyDefActions #-}
+
+{-# NOINLINE happyShift #-}
+{-# NOINLINE happySpecReduce_0 #-}
+{-# NOINLINE happySpecReduce_1 #-}
+{-# NOINLINE happySpecReduce_2 #-}
+{-# NOINLINE happySpecReduce_3 #-}
+{-# NOINLINE happyReduce #-}
+{-# NOINLINE happyMonadReduce #-}
+{-# NOINLINE happyGoto #-}
+{-# NOINLINE happyFail #-}
+
+-- end of Happy Template.
+
diff --git a/dist/build/unit-tests/unit-tests-tmp/LexBNF.hs b/dist/build/unit-tests/unit-tests-tmp/LexBNF.hs
deleted file mode 100644
--- a/dist/build/unit-tests/unit-tests-tmp/LexBNF.hs
+++ /dev/null
@@ -1,432 +0,0 @@
-{-# LANGUAGE CPP,MagicHash #-}
-{-# LINE 3 "src/LexBNF.x" #-}
-
-{-# OPTIONS -fno-warn-incomplete-patterns #-}
-{-# OPTIONS_GHC -w #-}
-module LexBNF where
-
-
-
-import qualified Data.Bits
-import Data.Word (Word8)
-import Data.Char (ord)
-
-#if __GLASGOW_HASKELL__ >= 603
-#include "ghcconfig.h"
-#elif defined(__GLASGOW_HASKELL__)
-#include "config.h"
-#endif
-#if __GLASGOW_HASKELL__ >= 503
-import Data.Array
-import Data.Char (ord)
-import Data.Array.Base (unsafeAt)
-#else
-import Array
-import Char (ord)
-#endif
-#if __GLASGOW_HASKELL__ >= 503
-import GHC.Exts
-#else
-import GlaExts
-#endif
-alex_base :: AlexAddr
-alex_base = AlexA# "\xf8\xff\xff\xff\x49\x00\x00\x00\xc9\xff\xff\xff\xe0\xff\xff\xff\xc9\x00\x00\x00\x9c\x01\x00\x00\x2d\x00\x00\x00\x1c\x02\x00\x00\x1c\x03\x00\x00\x0a\x01\x00\x00\x00\x00\x00\x00\x0d\x03\x00\x00\x0d\x04\x00\x00\xcd\x03\x00\x00\xcd\x04\x00\x00\x91\x05\x00\x00\xef\x05\x00\x00\x8d\x04\x00\x00\x00\x00\x00\x00\xa5\x05\x00\x00\xdb\xff\xff\xff\x47\x00\x00\x00\x5a\x00\x00\x00\xa5\x06\x00\x00\xa6\x06\x00\x00\x69\x07\x00\x00\x29\x07\x00\x00\x00\x00\x00\x00\x1f\x08\x00\x00\x00\x00\x00\x00\x78\x00\x00\x00\xdc\xff\xff\xff\xdd\xff\xff\xff\x00\x00\x00\x00\xdf\xff\xff\xff\xf8\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x72\x00\x00\x00\xe7\x05\x00\x00\x7c\x00\x00\x00"#
-
-alex_table :: AlexAddr
-alex_table = AlexA# "\x00\x00\x1e\x00\x1e\x00\x1e\x00\x1e\x00\x1e\x00\x21\x00\x25\x00\x16\x00\x1c\x00\x05\x00\x28\x00\x28\x00\x28\x00\x28\x00\x28\x00\x28\x00\x28\x00\x28\x00\x28\x00\x28\x00\x00\x00\x00\x00\x00\x00\x1e\x00\x02\x00\x17\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0e\x00\x21\x00\x21\x00\x21\x00\x21\x00\x21\x00\x1f\x00\x21\x00\x00\x00\x26\x00\x26\x00\x26\x00\x26\x00\x26\x00\x26\x00\x26\x00\x26\x00\x26\x00\x26\x00\x22\x00\x21\x00\x00\x00\x21\x00\x00\x00\x21\x00\x00\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x21\x00\x03\x00\x21\x00\x00\x00\x21\x00\x00\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x20\x00\x21\x00\x21\x00\x01\x00\x27\x00\x27\x00\x27\x00\x27\x00\x27\x00\x27\x00\x27\x00\x27\x00\x27\x00\x27\x00\x1e\x00\x1e\x00\x1e\x00\x1e\x00\x1e\x00\x00\x00\x00\x00\x00\x00\x03\x00\x28\x00\x28\x00\x28\x00\x28\x00\x28\x00\x28\x00\x28\x00\x28\x00\x28\x00\x28\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1e\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x15\x00\x03\x00\x26\x00\x26\x00\x26\x00\x26\x00\x26\x00\x26\x00\x26\x00\x26\x00\x26\x00\x26\x00\x28\x00\x28\x00\x28\x00\x28\x00\x28\x00\x28\x00\x28\x00\x28\x00\x28\x00\x28\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x18\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1d\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x08\x00\x09\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x19\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x01\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x08\x00\x09\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x04\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x13\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x00\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x06\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x0c\x00\x0d\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x17\x00\x00\x00\x00\x00\x00\x00\x00\x00\x17\x00\x27\x00\x27\x00\x27\x00\x27\x00\x27\x00\x27\x00\x27\x00\x27\x00\x27\x00\x27\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x17\x00\x14\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x17\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x17\x00\x1a\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x00\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x24\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x10\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x00\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x00\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x00\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x00\x00\x0f\x00\x11\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x19\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1a\x00\x04\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x12\x00\x13\x00\x07\x00\x0a\x00\x0a\x00\x0a\x00\x0b\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x23\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x00\x00\x00\x00\x00\x00\x00\x00\x23\x00\x00\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x23\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x18\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"#
-
-alex_check :: AlexAddr
-alex_check = AlexA# "\xff\xff\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x3d\x00\x27\x00\x2d\x00\x2d\x00\x2d\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\xff\xff\xff\xff\x20\x00\x3a\x00\x22\x00\xff\xff\xff\xff\xff\xff\xff\xff\x27\x00\x28\x00\x29\x00\x2a\x00\x2b\x00\x2c\x00\x2d\x00\x2e\x00\xff\xff\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\xff\xff\x3d\x00\xff\xff\x3f\x00\xff\xff\x41\x00\x42\x00\x43\x00\x44\x00\x45\x00\x46\x00\x47\x00\x48\x00\x49\x00\x4a\x00\x4b\x00\x4c\x00\x4d\x00\x4e\x00\x4f\x00\x50\x00\x51\x00\x52\x00\x53\x00\x54\x00\x55\x00\x56\x00\x57\x00\x58\x00\x59\x00\x5a\x00\x5b\x00\x27\x00\x5d\x00\xff\xff\x5f\x00\xff\xff\x61\x00\x62\x00\x63\x00\x64\x00\x65\x00\x66\x00\x67\x00\x68\x00\x69\x00\x6a\x00\x6b\x00\x6c\x00\x6d\x00\x6e\x00\x6f\x00\x70\x00\x71\x00\x72\x00\x73\x00\x74\x00\x75\x00\x76\x00\x77\x00\x78\x00\x79\x00\x7a\x00\x7b\x00\x7c\x00\x7d\x00\x2d\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\xff\xff\xff\xff\xff\xff\x5c\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\xff\xff\xff\xff\xff\xff\x20\x00\xff\xff\xff\xff\x6e\x00\xff\xff\xff\xff\xff\xff\xff\xff\x2e\x00\x74\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc3\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x7d\x00\xff\xff\xff\xff\x80\x00\x81\x00\x82\x00\x83\x00\x84\x00\x85\x00\x86\x00\x87\x00\x88\x00\x89\x00\x8a\x00\x8b\x00\x8c\x00\x8d\x00\x8e\x00\x8f\x00\x90\x00\x91\x00\x92\x00\x93\x00\x94\x00\x95\x00\x96\x00\x97\x00\x98\x00\x99\x00\x9a\x00\x9b\x00\x9c\x00\x9d\x00\x9e\x00\x9f\x00\xa0\x00\xa1\x00\xa2\x00\xa3\x00\xa4\x00\xa5\x00\xa6\x00\xa7\x00\xa8\x00\xa9\x00\xaa\x00\xab\x00\xac\x00\xad\x00\xae\x00\xaf\x00\xb0\x00\xb1\x00\xb2\x00\xb3\x00\xb4\x00\xb5\x00\xb6\x00\xb7\x00\xb8\x00\xb9\x00\xba\x00\xbb\x00\xbc\x00\xbd\x00\xbe\x00\xbf\x00\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\xd7\x00\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\xf7\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00\x80\x00\x81\x00\x82\x00\x83\x00\x84\x00\x85\x00\x86\x00\x87\x00\x88\x00\x89\x00\x8a\x00\x8b\x00\x8c\x00\x8d\x00\x8e\x00\x8f\x00\x90\x00\x91\x00\x92\x00\x93\x00\x94\x00\x95\x00\x96\x00\x97\x00\x98\x00\x99\x00\x9a\x00\x9b\x00\x9c\x00\x9d\x00\x9e\x00\x9f\x00\xa0\x00\xa1\x00\xa2\x00\xa3\x00\xa4\x00\xa5\x00\xa6\x00\xa7\x00\xa8\x00\xa9\x00\xaa\x00\xab\x00\xac\x00\xad\x00\xae\x00\xaf\x00\xb0\x00\xb1\x00\xb2\x00\xb3\x00\xb4\x00\xb5\x00\xb6\x00\xb7\x00\xb8\x00\xb9\x00\xba\x00\xbb\x00\xbc\x00\xbd\x00\xbe\x00\xbf\x00\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\xd7\x00\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\xf7\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00\x2d\x00\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\xd7\x00\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\xf7\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x80\x00\x81\x00\x82\x00\x83\x00\x84\x00\x85\x00\x86\x00\x87\x00\x88\x00\x89\x00\x8a\x00\x8b\x00\x8c\x00\x8d\x00\x8e\x00\x8f\x00\x90\x00\x91\x00\x92\x00\x93\x00\x94\x00\x95\x00\x96\x00\x97\x00\x98\x00\x99\x00\x9a\x00\x9b\x00\x9c\x00\x9d\x00\x9e\x00\x9f\x00\xa0\x00\xa1\x00\xa2\x00\xa3\x00\xa4\x00\xa5\x00\xa6\x00\xa7\x00\xa8\x00\xa9\x00\xaa\x00\xab\x00\xac\x00\xad\x00\xae\x00\xaf\x00\xb0\x00\xb1\x00\xb2\x00\xb3\x00\xb4\x00\xb5\x00\xb6\x00\xb7\x00\xb8\x00\xb9\x00\xba\x00\xbb\x00\xbc\x00\xbd\x00\xbe\x00\xbf\x00\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\xd7\x00\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\xf7\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00\x80\x00\x81\x00\x82\x00\x83\x00\x84\x00\x85\x00\x86\x00\x87\x00\x88\x00\x89\x00\x8a\x00\x8b\x00\x8c\x00\x8d\x00\x8e\x00\x8f\x00\x90\x00\x91\x00\x92\x00\x93\x00\x94\x00\x95\x00\x96\x00\x97\x00\x98\x00\x99\x00\x9a\x00\x9b\x00\x9c\x00\x9d\x00\x9e\x00\x9f\x00\xa0\x00\xa1\x00\xa2\x00\xa3\x00\xa4\x00\xa5\x00\xa6\x00\xa7\x00\xa8\x00\xa9\x00\xaa\x00\xab\x00\xac\x00\xad\x00\xae\x00\xaf\x00\xb0\x00\xb1\x00\xb2\x00\xb3\x00\xb4\x00\xb5\x00\xb6\x00\xb7\x00\xb8\x00\xb9\x00\xba\x00\xbb\x00\xbc\x00\xbd\x00\xbe\x00\xbf\x00\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\xd7\x00\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\xf7\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\x2b\x00\x2c\x00\x2d\x00\x2e\x00\x2f\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x3e\x00\x3f\x00\x40\x00\x41\x00\x42\x00\x43\x00\x44\x00\x45\x00\x46\x00\x47\x00\x48\x00\x49\x00\x4a\x00\x4b\x00\x4c\x00\x4d\x00\x4e\x00\x4f\x00\x50\x00\x51\x00\x52\x00\x53\x00\x54\x00\x55\x00\x56\x00\x57\x00\x58\x00\x59\x00\x5a\x00\x5b\x00\x5c\x00\x5d\x00\x5e\x00\x5f\x00\x60\x00\x61\x00\x62\x00\x63\x00\x64\x00\x65\x00\x66\x00\x67\x00\x68\x00\x69\x00\x6a\x00\x6b\x00\x6c\x00\x6d\x00\x6e\x00\x6f\x00\x70\x00\x71\x00\x72\x00\x73\x00\x74\x00\x75\x00\x76\x00\x77\x00\x78\x00\x79\x00\x7a\x00\x7b\x00\x7c\x00\x7d\x00\x7e\x00\x7f\x00\x8f\x00\x90\x00\x91\x00\x92\x00\x93\x00\x94\x00\x95\x00\x96\x00\x97\x00\x98\x00\x99\x00\x9a\x00\x9b\x00\x9c\x00\x9d\x00\x9e\x00\x9f\x00\xa0\x00\xa1\x00\xa2\x00\xa3\x00\xa4\x00\xa5\x00\xa6\x00\xa7\x00\xa8\x00\xa9\x00\xaa\x00\xab\x00\xac\x00\xad\x00\xae\x00\xaf\x00\xb0\x00\xb1\x00\xb2\x00\xb3\x00\xb4\x00\xb5\x00\xb6\x00\xb7\x00\xb8\x00\xb9\x00\xba\x00\xbb\x00\xbc\x00\xbd\x00\xbe\x00\xbf\x00\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\xd7\x00\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\xf7\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\x2b\x00\x2c\x00\x2d\x00\x2e\x00\x2f\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x3e\x00\x3f\x00\x40\x00\x41\x00\x42\x00\x43\x00\x44\x00\x45\x00\x46\x00\x47\x00\x48\x00\x49\x00\x4a\x00\x4b\x00\x4c\x00\x4d\x00\x4e\x00\x4f\x00\x50\x00\x51\x00\x52\x00\x53\x00\x54\x00\x55\x00\x56\x00\x57\x00\x58\x00\x59\x00\x5a\x00\x5b\x00\x5c\x00\x5d\x00\x5e\x00\x5f\x00\x60\x00\x61\x00\x62\x00\x63\x00\x64\x00\x65\x00\x66\x00\x67\x00\x68\x00\x69\x00\x6a\x00\x6b\x00\x6c\x00\x6d\x00\x6e\x00\x6f\x00\x70\x00\x71\x00\x72\x00\x73\x00\x74\x00\x75\x00\x76\x00\x77\x00\x78\x00\x79\x00\x7a\x00\x7b\x00\x7c\x00\x7d\x00\x7e\x00\x7f\x00\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\xd7\x00\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\xf7\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\xff\xff\x28\x00\x29\x00\x2a\x00\x2b\x00\x2c\x00\x2d\x00\x2e\x00\x2f\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x3e\x00\x3f\x00\x40\x00\x41\x00\x42\x00\x43\x00\x44\x00\x45\x00\x46\x00\x47\x00\x48\x00\x49\x00\x4a\x00\x4b\x00\x4c\x00\x4d\x00\x4e\x00\x4f\x00\x50\x00\x51\x00\x52\x00\x53\x00\x54\x00\x55\x00\x56\x00\x57\x00\x58\x00\x59\x00\x5a\x00\x5b\x00\x5c\x00\x5d\x00\x5e\x00\x5f\x00\x60\x00\x61\x00\x62\x00\x63\x00\x64\x00\x65\x00\x66\x00\x67\x00\x68\x00\x69\x00\x6a\x00\x6b\x00\x6c\x00\x6d\x00\x6e\x00\x6f\x00\x70\x00\x71\x00\x72\x00\x73\x00\x74\x00\x75\x00\x76\x00\x77\x00\x78\x00\x79\x00\x7a\x00\x7b\x00\x7c\x00\x7d\x00\x7e\x00\x7f\x00\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\xd7\x00\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\xf7\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00\xff\xff\xff\xff\xc2\x00\xc3\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\x2b\x00\x2c\x00\x2d\x00\x2e\x00\x2f\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x3e\x00\x3f\x00\x40\x00\x41\x00\x42\x00\x43\x00\x44\x00\x45\x00\x46\x00\x47\x00\x48\x00\x49\x00\x4a\x00\x4b\x00\x4c\x00\x4d\x00\x4e\x00\x4f\x00\x50\x00\x51\x00\x52\x00\x53\x00\x54\x00\x55\x00\x56\x00\x57\x00\x58\x00\x59\x00\x5a\x00\x5b\x00\x5c\x00\x5d\x00\x5e\x00\x5f\x00\x60\x00\x61\x00\x62\x00\x63\x00\x64\x00\x65\x00\x66\x00\x67\x00\x68\x00\x69\x00\x6a\x00\x6b\x00\x6c\x00\x6d\x00\x6e\x00\x6f\x00\x70\x00\x71\x00\x72\x00\x73\x00\x74\x00\x75\x00\x76\x00\x77\x00\x78\x00\x79\x00\x7a\x00\x7b\x00\x7c\x00\x7d\x00\x7e\x00\x7f\x00\x22\x00\xff\xff\xff\xff\xff\xff\xff\xff\x27\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x5c\x00\x65\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x6e\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x74\x00\xbf\x00\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\xd7\x00\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\xf7\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x09\x00\xff\xff\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\x2b\x00\x2c\x00\x2d\x00\x2e\x00\x2f\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x3e\x00\x3f\x00\x40\x00\x41\x00\x42\x00\x43\x00\x44\x00\x45\x00\x46\x00\x47\x00\x48\x00\x49\x00\x4a\x00\x4b\x00\x4c\x00\x4d\x00\x4e\x00\x4f\x00\x50\x00\x51\x00\x52\x00\x53\x00\x54\x00\x55\x00\x56\x00\x57\x00\x58\x00\x59\x00\x5a\x00\x5b\x00\x5c\x00\x5d\x00\x5e\x00\x5f\x00\x60\x00\x61\x00\x62\x00\x63\x00\x64\x00\x65\x00\x66\x00\x67\x00\x68\x00\x69\x00\x6a\x00\x6b\x00\x6c\x00\x6d\x00\x6e\x00\x6f\x00\x70\x00\x71\x00\x72\x00\x73\x00\x74\x00\x75\x00\x76\x00\x77\x00\x78\x00\x79\x00\x7a\x00\x7b\x00\x7c\x00\x7d\x00\x7e\x00\x7f\x00\xff\xff\x80\x00\x81\x00\x82\x00\x83\x00\x84\x00\x85\x00\x86\x00\x87\x00\x88\x00\x89\x00\x8a\x00\x8b\x00\x8c\x00\x8d\x00\x8e\x00\x8f\x00\x90\x00\x91\x00\x92\x00\x93\x00\x94\x00\x95\x00\x96\x00\xff\xff\x98\x00\x99\x00\x9a\x00\x9b\x00\x9c\x00\x9d\x00\x9e\x00\x9f\x00\xa0\x00\xa1\x00\xa2\x00\xa3\x00\xa4\x00\xa5\x00\xa6\x00\xa7\x00\xa8\x00\xa9\x00\xaa\x00\xab\x00\xac\x00\xad\x00\xae\x00\xaf\x00\xb0\x00\xb1\x00\xb2\x00\xb3\x00\xb4\x00\xb5\x00\xb6\x00\xff\xff\xb8\x00\xb9\x00\xba\x00\xbb\x00\xbc\x00\xbd\x00\xbe\x00\xbf\x00\xff\xff\xc2\x00\xc3\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\x2b\x00\x2c\x00\x2d\x00\x2e\x00\x2f\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x3e\x00\x3f\x00\x40\x00\x41\x00\x42\x00\x43\x00\x44\x00\x45\x00\x46\x00\x47\x00\x48\x00\x49\x00\x4a\x00\x4b\x00\x4c\x00\x4d\x00\x4e\x00\x4f\x00\x50\x00\x51\x00\x52\x00\x53\x00\x54\x00\x55\x00\x56\x00\x57\x00\x58\x00\x59\x00\x5a\x00\x5b\x00\x5c\x00\x5d\x00\x5e\x00\x5f\x00\x60\x00\x61\x00\x62\x00\x63\x00\x64\x00\x65\x00\x66\x00\x67\x00\x68\x00\x69\x00\x6a\x00\x6b\x00\x6c\x00\x6d\x00\x6e\x00\x6f\x00\x70\x00\x71\x00\x72\x00\x73\x00\x74\x00\x75\x00\x76\x00\x77\x00\x78\x00\x79\x00\x7a\x00\x7b\x00\x7c\x00\x7d\x00\x7e\x00\x7f\x00\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\xd7\x00\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\xf7\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00\x0a\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x80\x00\x81\x00\x82\x00\x83\x00\x84\x00\x85\x00\x86\x00\x87\x00\x88\x00\x89\x00\x8a\x00\x8b\x00\x8c\x00\x8d\x00\x8e\x00\x8f\x00\x90\x00\x91\x00\x92\x00\x93\x00\x94\x00\x95\x00\x96\x00\x97\x00\x98\x00\x99\x00\x9a\x00\x9b\x00\x9c\x00\x9d\x00\x9e\x00\x9f\x00\xa0\x00\xa1\x00\xa2\x00\xa3\x00\xa4\x00\xa5\x00\xa6\x00\xa7\x00\xa8\x00\xa9\x00\xaa\x00\xab\x00\xac\x00\xad\x00\xae\x00\xaf\x00\xb0\x00\xb1\x00\xb2\x00\xb3\x00\xb4\x00\xb5\x00\xb6\x00\xb7\x00\xb8\x00\xb9\x00\xba\x00\xbb\x00\xbc\x00\xbd\x00\xbe\x00\xbf\x00\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\xd7\x00\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\xf7\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00\x27\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x41\x00\x42\x00\x43\x00\x44\x00\x45\x00\x46\x00\x47\x00\x48\x00\x49\x00\x4a\x00\x4b\x00\x4c\x00\x4d\x00\x4e\x00\x4f\x00\x50\x00\x51\x00\x52\x00\x53\x00\x54\x00\x55\x00\x56\x00\x57\x00\x58\x00\x59\x00\x5a\x00\xff\xff\xff\xff\xff\xff\xff\xff\x5f\x00\xff\xff\x61\x00\x62\x00\x63\x00\x64\x00\x65\x00\x66\x00\x67\x00\x68\x00\x69\x00\x6a\x00\x6b\x00\x6c\x00\x6d\x00\x6e\x00\x6f\x00\x70\x00\x71\x00\x72\x00\x73\x00\x74\x00\x75\x00\x76\x00\x77\x00\x78\x00\x79\x00\x7a\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc3\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"#
-
-alex_deflt :: AlexAddr
-alex_deflt = AlexA# "\xff\xff\x05\x00\xff\xff\xff\xff\xff\xff\x05\x00\xff\xff\xff\xff\x05\x00\x05\x00\x12\x00\x12\x00\x03\x00\x03\x00\xff\xff\x17\x00\xff\xff\x17\x00\x1b\x00\x1b\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1c\x00\x1c\x00\x1c\x00\x1c\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"#
-
-alex_accept = listArray (0::Int,40) [AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccSkip,AlexAccSkip,AlexAccSkip,AlexAcc (alex_action_3),AlexAcc (alex_action_3),AlexAcc (alex_action_3),AlexAcc (alex_action_3),AlexAcc (alex_action_4),AlexAcc (alex_action_5),AlexAcc (alex_action_6),AlexAcc (alex_action_7),AlexAcc (alex_action_8),AlexAcc (alex_action_8)]
-{-# LINE 39 "src/LexBNF.x" #-}
-
-
-tok :: (Posn -> String -> Token) -> (Posn -> String -> Token)
-tok f p s = f p s
-
-share :: String -> String
-share = id
-
-data Tok =
-   TS !String !Int    -- reserved words and symbols
- | TL !String         -- string literals
- | TI !String         -- integer literals
- | TV !String         -- identifiers
- | TD !String         -- double precision float literals
- | TC !String         -- character literals
-
- deriving (Eq,Show,Ord)
-
-data Token =
-   PT  Posn Tok
- | Err Posn
-  deriving (Eq,Show,Ord)
-
-tokenPos :: [Token] -> String
-tokenPos (PT (Pn _ l _) _ :_) = "line " ++ show l
-tokenPos (Err (Pn _ l _) :_) = "line " ++ show l
-tokenPos _ = "end of file"
-
-tokenPosn :: Token -> Posn
-tokenPosn (PT p _) = p
-tokenPosn (Err p) = p
-
-tokenLineCol :: Token -> (Int, Int)
-tokenLineCol = posLineCol . tokenPosn
-
-posLineCol :: Posn -> (Int, Int)
-posLineCol (Pn _ l c) = (l,c)
-
-mkPosToken :: Token -> ((Int, Int), String)
-mkPosToken t@(PT p _) = (posLineCol p, prToken t)
-
-prToken :: Token -> String
-prToken t = case t of
-  PT _ (TS s _) -> s
-  PT _ (TL s)   -> s
-  PT _ (TI s)   -> s
-  PT _ (TV s)   -> s
-  PT _ (TD s)   -> s
-  PT _ (TC s)   -> s
-  Err _ -> "#Error"
-
-
-data BTree = N | B String Tok BTree BTree deriving (Show)
-
-eitherResIdent :: (String -> Tok) -> String -> Tok
-eitherResIdent tv s = treeFind resWords
-  where
-  treeFind N = tv s
-  treeFind (B a t left right) | s < a  = treeFind left
-                              | s > a  = treeFind right
-                              | s == a = t
-
-resWords :: BTree
-resWords = b "digit" 21 (b "=" 11 (b "-" 6 (b "*" 3 (b ")" 2 (b "(" 1 N N) N) (b "," 5 (b "+" 4 N N) N)) (b "::=" 9 (b ":" 8 (b "." 7 N N) N) (b ";" 10 N N))) (b "char" 16 (b "]" 14 (b "[" 13 (b "?" 12 N N) N) (b "_" 15 N N)) (b "define" 19 (b "comment" 18 (b "coercions" 17 N N) N) (b "delimiters" 20 N N)))) (b "separator" 31 (b "letter" 26 (b "internal" 24 (b "eps" 23 (b "entrypoints" 22 N N) N) (b "layout" 25 N N)) (b "position" 29 (b "nonempty" 28 (b "lower" 27 N N) N) (b "rules" 30 N N))) (b "upper" 36 (b "token" 34 (b "terminator" 33 (b "stop" 32 N N) N) (b "toplevel" 35 N N)) (b "|" 39 (b "{" 38 (b "views" 37 N N) N) (b "}" 40 N N))))
-   where b s n = let bs = id s
-                  in B bs (TS bs n)
-
-unescapeInitTail :: String -> String
-unescapeInitTail = id . unesc . tail . id where
-  unesc s = case s of
-    '\\':c:cs | elem c ['\"', '\\', '\''] -> c : unesc cs
-    '\\':'n':cs  -> '\n' : unesc cs
-    '\\':'t':cs  -> '\t' : unesc cs
-    '"':[]    -> []
-    c:cs      -> c : unesc cs
-    _         -> []
-
--------------------------------------------------------------------
--- Alex wrapper code.
--- A modified "posn" wrapper.
--------------------------------------------------------------------
-
-data Posn = Pn !Int !Int !Int
-      deriving (Eq, Show,Ord)
-
-alexStartPos :: Posn
-alexStartPos = Pn 0 1 1
-
-alexMove :: Posn -> Char -> Posn
-alexMove (Pn a l c) '\t' = Pn (a+1)  l     (((c+7) `div` 8)*8+1)
-alexMove (Pn a l c) '\n' = Pn (a+1) (l+1)   1
-alexMove (Pn a l c) _    = Pn (a+1)  l     (c+1)
-
-type Byte = Word8
-
-type AlexInput = (Posn,     -- current position,
-                  Char,     -- previous char
-                  [Byte],   -- pending bytes on the current char
-                  String)   -- current input string
-
-tokens :: String -> [Token]
-tokens str = go (alexStartPos, '\n', [], str)
-    where
-      go :: AlexInput -> [Token]
-      go inp@(pos, _, _, str) =
-               case alexScan inp 0 of
-                AlexEOF                   -> []
-                AlexError (pos, _, _, _)  -> [Err pos]
-                AlexSkip  inp' len        -> go inp'
-                AlexToken inp' len act    -> act pos (take len str) : (go inp')
-
-alexGetByte :: AlexInput -> Maybe (Byte,AlexInput)
-alexGetByte (p, c, (b:bs), s) = Just (b, (p, c, bs, s))
-alexGetByte (p, _, [], s) =
-  case  s of
-    []  -> Nothing
-    (c:s) ->
-             let p'     = alexMove p c
-                 (b:bs) = utf8Encode c
-              in p' `seq` Just (b, (p', c, bs, s))
-
-alexInputPrevChar :: AlexInput -> Char
-alexInputPrevChar (p, c, bs, s) = c
-
--- | Encode a Haskell String to a list of Word8 values, in UTF8 format.
-utf8Encode :: Char -> [Word8]
-utf8Encode = map fromIntegral . go . ord
- where
-  go oc
-   | oc <= 0x7f       = [oc]
-
-   | oc <= 0x7ff      = [ 0xc0 + (oc `Data.Bits.shiftR` 6)
-                        , 0x80 + oc Data.Bits..&. 0x3f
-                        ]
-
-   | oc <= 0xffff     = [ 0xe0 + (oc `Data.Bits.shiftR` 12)
-                        , 0x80 + ((oc `Data.Bits.shiftR` 6) Data.Bits..&. 0x3f)
-                        , 0x80 + oc Data.Bits..&. 0x3f
-                        ]
-   | otherwise        = [ 0xf0 + (oc `Data.Bits.shiftR` 18)
-                        , 0x80 + ((oc `Data.Bits.shiftR` 12) Data.Bits..&. 0x3f)
-                        , 0x80 + ((oc `Data.Bits.shiftR` 6) Data.Bits..&. 0x3f)
-                        , 0x80 + oc Data.Bits..&. 0x3f
-                        ]
-
-alex_action_3 =  tok (\p s -> PT p (eitherResIdent (TV . share) s)) 
-alex_action_4 =  tok (\p s -> PT p (eitherResIdent (TV . share) s)) 
-alex_action_5 =  tok (\p s -> PT p (TL $ share $ unescapeInitTail s)) 
-alex_action_6 =  tok (\p s -> PT p (TC $ share s))  
-alex_action_7 =  tok (\p s -> PT p (TI $ share s))    
-alex_action_8 =  tok (\p s -> PT p (TD $ share s)) 
-{-# LINE 1 "templates/GenericTemplate.hs" #-}
-{-# LINE 1 "templates/GenericTemplate.hs" #-}
-{-# LINE 1 "<built-in>" #-}
-{-# LINE 1 "<command-line>" #-}
-{-# LINE 9 "<command-line>" #-}
-# 1 "/usr/include/stdc-predef.h" 1 3 4
-
-# 17 "/usr/include/stdc-predef.h" 3 4
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-{-# LINE 9 "<command-line>" #-}
-{-# LINE 1 "templates/GenericTemplate.hs" #-}
--- -----------------------------------------------------------------------------
--- ALEX TEMPLATE
---
--- This code is in the PUBLIC DOMAIN; you may copy it freely and use
--- it for any purpose whatsoever.
-
--- -----------------------------------------------------------------------------
--- INTERNALS and main scanner engine
-
-{-# LINE 21 "templates/GenericTemplate.hs" #-}
-
-
-
-
-
--- Do not remove this comment. Required to fix CPP parsing when using GCC and a clang-compiled alex.
-#if __GLASGOW_HASKELL__ > 706
-#define GTE(n,m) (tagToEnum# (n >=# m))
-#define EQ(n,m) (tagToEnum# (n ==# m))
-#else
-#define GTE(n,m) (n >=# m)
-#define EQ(n,m) (n ==# m)
-#endif
-{-# LINE 51 "templates/GenericTemplate.hs" #-}
-
-
-data AlexAddr = AlexA# Addr#
--- Do not remove this comment. Required to fix CPP parsing when using GCC and a clang-compiled alex.
-#if __GLASGOW_HASKELL__ < 503
-uncheckedShiftL# = shiftL#
-#endif
-
-{-# INLINE alexIndexInt16OffAddr #-}
-alexIndexInt16OffAddr (AlexA# arr) off =
-#ifdef WORDS_BIGENDIAN
-  narrow16Int# i
-  where
-        i    = word2Int# ((high `uncheckedShiftL#` 8#) `or#` low)
-        high = int2Word# (ord# (indexCharOffAddr# arr (off' +# 1#)))
-        low  = int2Word# (ord# (indexCharOffAddr# arr off'))
-        off' = off *# 2#
-#else
-  indexInt16OffAddr# arr off
-#endif
-
-
-
-
-
-{-# INLINE alexIndexInt32OffAddr #-}
-alexIndexInt32OffAddr (AlexA# arr) off = 
-#ifdef WORDS_BIGENDIAN
-  narrow32Int# i
-  where
-   i    = word2Int# ((b3 `uncheckedShiftL#` 24#) `or#`
-		     (b2 `uncheckedShiftL#` 16#) `or#`
-		     (b1 `uncheckedShiftL#` 8#) `or#` b0)
-   b3   = int2Word# (ord# (indexCharOffAddr# arr (off' +# 3#)))
-   b2   = int2Word# (ord# (indexCharOffAddr# arr (off' +# 2#)))
-   b1   = int2Word# (ord# (indexCharOffAddr# arr (off' +# 1#)))
-   b0   = int2Word# (ord# (indexCharOffAddr# arr off'))
-   off' = off *# 4#
-#else
-  indexInt32OffAddr# arr off
-#endif
-
-
-
-
-
-
-#if __GLASGOW_HASKELL__ < 503
-quickIndex arr i = arr ! i
-#else
--- GHC >= 503, unsafeAt is available from Data.Array.Base.
-quickIndex = unsafeAt
-#endif
-
-
-
-
--- -----------------------------------------------------------------------------
--- Main lexing routines
-
-data AlexReturn a
-  = AlexEOF
-  | AlexError  !AlexInput
-  | AlexSkip   !AlexInput !Int
-  | AlexToken  !AlexInput !Int a
-
--- alexScan :: AlexInput -> StartCode -> AlexReturn a
-alexScan input (I# (sc))
-  = alexScanUser undefined input (I# (sc))
-
-alexScanUser user input (I# (sc))
-  = case alex_scan_tkn user input 0# input sc AlexNone of
-	(AlexNone, input') ->
-		case alexGetByte input of
-			Nothing -> 
-
-
-
-				   AlexEOF
-			Just _ ->
-
-
-
-				   AlexError input'
-
-	(AlexLastSkip input'' len, _) ->
-
-
-
-		AlexSkip input'' len
-
-	(AlexLastAcc k input''' len, _) ->
-
-
-
-		AlexToken input''' len k
-
-
--- Push the input through the DFA, remembering the most recent accepting
--- state it encountered.
-
-alex_scan_tkn user orig_input len input s last_acc =
-  input `seq` -- strict in the input
-  let 
-	new_acc = (check_accs (alex_accept `quickIndex` (I# (s))))
-  in
-  new_acc `seq`
-  case alexGetByte input of
-     Nothing -> (new_acc, input)
-     Just (c, new_input) -> 
-
-
-
-      case fromIntegral c of { (I# (ord_c)) ->
-        let
-                base   = alexIndexInt32OffAddr alex_base s
-                offset = (base +# ord_c)
-                check  = alexIndexInt16OffAddr alex_check offset
-		
-                new_s = if GTE(offset,0#) && EQ(check,ord_c)
-			  then alexIndexInt16OffAddr alex_table offset
-			  else alexIndexInt16OffAddr alex_deflt s
-	in
-        case new_s of
-	    -1# -> (new_acc, input)
-		-- on an error, we want to keep the input *before* the
-		-- character that failed, not after.
-    	    _ -> alex_scan_tkn user orig_input (if c < 0x80 || c >= 0xC0 then (len +# 1#) else len)
-                                                -- note that the length is increased ONLY if this is the 1st byte in a char encoding)
-			new_input new_s new_acc
-      }
-  where
-	check_accs (AlexAccNone) = last_acc
-	check_accs (AlexAcc a  ) = AlexLastAcc a input (I# (len))
-	check_accs (AlexAccSkip) = AlexLastSkip  input (I# (len))
-{-# LINE 198 "templates/GenericTemplate.hs" #-}
-
-data AlexLastAcc a
-  = AlexNone
-  | AlexLastAcc a !AlexInput !Int
-  | AlexLastSkip  !AlexInput !Int
-
-instance Functor AlexLastAcc where
-    fmap f AlexNone = AlexNone
-    fmap f (AlexLastAcc x y z) = AlexLastAcc (f x) y z
-    fmap f (AlexLastSkip x y) = AlexLastSkip x y
-
-data AlexAcc a user
-  = AlexAccNone
-  | AlexAcc a
-  | AlexAccSkip
-{-# LINE 242 "templates/GenericTemplate.hs" #-}
-
--- used by wrappers
-iUnbox (I# (i)) = i
diff --git a/dist/build/unit-tests/unit-tests-tmp/ParBNF.hs b/dist/build/unit-tests/unit-tests-tmp/ParBNF.hs
deleted file mode 100644
--- a/dist/build/unit-tests/unit-tests-tmp/ParBNF.hs
+++ /dev/null
@@ -1,1776 +0,0 @@
-{-# OPTIONS_GHC -w #-}
-{-# OPTIONS -fglasgow-exts -cpp #-}
-{-# OPTIONS_GHC -fno-warn-incomplete-patterns -fno-warn-overlapping-patterns #-}
-module ParBNF where
-import AbsBNF
-import LexBNF
-import ErrM
-import qualified Data.Array as Happy_Data_Array
-import qualified GHC.Exts as Happy_GHC_Exts
-import Control.Applicative(Applicative(..))
-import Control.Monad (ap)
-
--- parser produced by Happy Version 1.19.5
-
-newtype HappyAbsSyn  = HappyAbsSyn HappyAny
-#if __GLASGOW_HASKELL__ >= 607
-type HappyAny = Happy_GHC_Exts.Any
-#else
-type HappyAny = forall a . a
-#endif
-happyIn36 :: (String) -> (HappyAbsSyn )
-happyIn36 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn36 #-}
-happyOut36 :: (HappyAbsSyn ) -> (String)
-happyOut36 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut36 #-}
-happyIn37 :: (Ident) -> (HappyAbsSyn )
-happyIn37 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn37 #-}
-happyOut37 :: (HappyAbsSyn ) -> (Ident)
-happyOut37 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut37 #-}
-happyIn38 :: (Integer) -> (HappyAbsSyn )
-happyIn38 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn38 #-}
-happyOut38 :: (HappyAbsSyn ) -> (Integer)
-happyOut38 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut38 #-}
-happyIn39 :: (Char) -> (HappyAbsSyn )
-happyIn39 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn39 #-}
-happyOut39 :: (HappyAbsSyn ) -> (Char)
-happyOut39 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut39 #-}
-happyIn40 :: (Double) -> (HappyAbsSyn )
-happyIn40 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn40 #-}
-happyOut40 :: (HappyAbsSyn ) -> (Double)
-happyOut40 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut40 #-}
-happyIn41 :: (LGrammar) -> (HappyAbsSyn )
-happyIn41 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn41 #-}
-happyOut41 :: (HappyAbsSyn ) -> (LGrammar)
-happyOut41 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut41 #-}
-happyIn42 :: (LDef) -> (HappyAbsSyn )
-happyIn42 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn42 #-}
-happyOut42 :: (HappyAbsSyn ) -> (LDef)
-happyOut42 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut42 #-}
-happyIn43 :: ([LDef]) -> (HappyAbsSyn )
-happyIn43 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn43 #-}
-happyOut43 :: (HappyAbsSyn ) -> ([LDef])
-happyOut43 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut43 #-}
-happyIn44 :: (Grammar) -> (HappyAbsSyn )
-happyIn44 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn44 #-}
-happyOut44 :: (HappyAbsSyn ) -> (Grammar)
-happyOut44 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut44 #-}
-happyIn45 :: ([Def]) -> (HappyAbsSyn )
-happyIn45 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn45 #-}
-happyOut45 :: (HappyAbsSyn ) -> ([Def])
-happyOut45 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut45 #-}
-happyIn46 :: ([Item]) -> (HappyAbsSyn )
-happyIn46 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn46 #-}
-happyOut46 :: (HappyAbsSyn ) -> ([Item])
-happyOut46 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut46 #-}
-happyIn47 :: (Def) -> (HappyAbsSyn )
-happyIn47 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn47 #-}
-happyOut47 :: (HappyAbsSyn ) -> (Def)
-happyOut47 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut47 #-}
-happyIn48 :: (Item) -> (HappyAbsSyn )
-happyIn48 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn48 #-}
-happyOut48 :: (HappyAbsSyn ) -> (Item)
-happyOut48 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut48 #-}
-happyIn49 :: (Cat) -> (HappyAbsSyn )
-happyIn49 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn49 #-}
-happyOut49 :: (HappyAbsSyn ) -> (Cat)
-happyOut49 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut49 #-}
-happyIn50 :: (Label) -> (HappyAbsSyn )
-happyIn50 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn50 #-}
-happyOut50 :: (HappyAbsSyn ) -> (Label)
-happyOut50 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut50 #-}
-happyIn51 :: (LabelId) -> (HappyAbsSyn )
-happyIn51 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn51 #-}
-happyOut51 :: (HappyAbsSyn ) -> (LabelId)
-happyOut51 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut51 #-}
-happyIn52 :: (ProfItem) -> (HappyAbsSyn )
-happyIn52 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn52 #-}
-happyOut52 :: (HappyAbsSyn ) -> (ProfItem)
-happyOut52 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut52 #-}
-happyIn53 :: (IntList) -> (HappyAbsSyn )
-happyIn53 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn53 #-}
-happyOut53 :: (HappyAbsSyn ) -> (IntList)
-happyOut53 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut53 #-}
-happyIn54 :: ([Integer]) -> (HappyAbsSyn )
-happyIn54 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn54 #-}
-happyOut54 :: (HappyAbsSyn ) -> ([Integer])
-happyOut54 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut54 #-}
-happyIn55 :: ([IntList]) -> (HappyAbsSyn )
-happyIn55 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn55 #-}
-happyOut55 :: (HappyAbsSyn ) -> ([IntList])
-happyOut55 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut55 #-}
-happyIn56 :: ([ProfItem]) -> (HappyAbsSyn )
-happyIn56 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn56 #-}
-happyOut56 :: (HappyAbsSyn ) -> ([ProfItem])
-happyOut56 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut56 #-}
-happyIn57 :: (Separation) -> (HappyAbsSyn )
-happyIn57 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn57 #-}
-happyOut57 :: (HappyAbsSyn ) -> (Separation)
-happyOut57 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut57 #-}
-happyIn58 :: (Arg) -> (HappyAbsSyn )
-happyIn58 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn58 #-}
-happyOut58 :: (HappyAbsSyn ) -> (Arg)
-happyOut58 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut58 #-}
-happyIn59 :: ([Arg]) -> (HappyAbsSyn )
-happyIn59 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn59 #-}
-happyOut59 :: (HappyAbsSyn ) -> ([Arg])
-happyOut59 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut59 #-}
-happyIn60 :: (Exp) -> (HappyAbsSyn )
-happyIn60 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn60 #-}
-happyOut60 :: (HappyAbsSyn ) -> (Exp)
-happyOut60 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut60 #-}
-happyIn61 :: (Exp) -> (HappyAbsSyn )
-happyIn61 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn61 #-}
-happyOut61 :: (HappyAbsSyn ) -> (Exp)
-happyOut61 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut61 #-}
-happyIn62 :: (Exp) -> (HappyAbsSyn )
-happyIn62 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn62 #-}
-happyOut62 :: (HappyAbsSyn ) -> (Exp)
-happyOut62 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut62 #-}
-happyIn63 :: ([Exp]) -> (HappyAbsSyn )
-happyIn63 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn63 #-}
-happyOut63 :: (HappyAbsSyn ) -> ([Exp])
-happyOut63 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut63 #-}
-happyIn64 :: ([Exp]) -> (HappyAbsSyn )
-happyIn64 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn64 #-}
-happyOut64 :: (HappyAbsSyn ) -> ([Exp])
-happyOut64 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut64 #-}
-happyIn65 :: ([String]) -> (HappyAbsSyn )
-happyIn65 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn65 #-}
-happyOut65 :: (HappyAbsSyn ) -> ([String])
-happyOut65 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut65 #-}
-happyIn66 :: ([RHS]) -> (HappyAbsSyn )
-happyIn66 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn66 #-}
-happyOut66 :: (HappyAbsSyn ) -> ([RHS])
-happyOut66 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut66 #-}
-happyIn67 :: (RHS) -> (HappyAbsSyn )
-happyIn67 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn67 #-}
-happyOut67 :: (HappyAbsSyn ) -> (RHS)
-happyOut67 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut67 #-}
-happyIn68 :: (MinimumSize) -> (HappyAbsSyn )
-happyIn68 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn68 #-}
-happyOut68 :: (HappyAbsSyn ) -> (MinimumSize)
-happyOut68 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut68 #-}
-happyIn69 :: (Reg) -> (HappyAbsSyn )
-happyIn69 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn69 #-}
-happyOut69 :: (HappyAbsSyn ) -> (Reg)
-happyOut69 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut69 #-}
-happyIn70 :: (Reg) -> (HappyAbsSyn )
-happyIn70 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn70 #-}
-happyOut70 :: (HappyAbsSyn ) -> (Reg)
-happyOut70 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut70 #-}
-happyIn71 :: (Reg) -> (HappyAbsSyn )
-happyIn71 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn71 #-}
-happyOut71 :: (HappyAbsSyn ) -> (Reg)
-happyOut71 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut71 #-}
-happyIn72 :: (Reg) -> (HappyAbsSyn )
-happyIn72 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn72 #-}
-happyOut72 :: (HappyAbsSyn ) -> (Reg)
-happyOut72 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut72 #-}
-happyIn73 :: ([Ident]) -> (HappyAbsSyn )
-happyIn73 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn73 #-}
-happyOut73 :: (HappyAbsSyn ) -> ([Ident])
-happyOut73 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut73 #-}
-happyInTok :: (Token) -> (HappyAbsSyn )
-happyInTok x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyInTok #-}
-happyOutTok :: (HappyAbsSyn ) -> (Token)
-happyOutTok x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOutTok #-}
-
-
-happyActOffsets :: HappyAddr
-happyActOffsets = HappyA# "\x45\x00\x45\x00\x45\x00\x64\x00\x64\x00\x00\x00\x64\x00\xbc\x00\xbd\x00\x71\x00\x71\x00\xda\x01\xd9\x01\xd8\x01\xd6\x01\xd7\x01\x7e\x01\xd5\x01\x00\x00\x07\x00\x07\x00\x07\x00\x07\x00\x07\x00\xd4\x01\x00\x00\x00\x00\xd3\x01\x29\x00\x29\x00\x29\x00\x29\x00\xd2\x01\xcc\x01\x00\x00\xd1\x01\xcb\x01\x00\x00\x00\x00\x11\x00\xd0\x01\x89\x01\xc8\x01\x29\x00\xc9\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc9\x01\x00\x00\x3e\x00\xe2\xff\x01\x00\xc5\x01\x00\x00\xbc\x00\xc5\x01\xc5\x01\xc4\x01\xcf\x01\xc3\x01\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\xce\x01\xca\x01\x00\x00\xc2\x01\x07\x00\x07\x00\x00\x00\x00\x00\x00\x00\x07\x00\xc2\x01\xc2\x01\xc2\x01\xc2\x01\x6a\x01\x00\x00\xc2\x01\xc2\x01\xc1\x01\xc1\x01\xcd\x01\xbf\x01\xc0\x01\xc7\x01\xbe\x01\xbc\x01\xc6\x01\xba\x01\xba\x01\xba\x01\x00\x00\xba\x01\xbd\x01\xb9\x01\x00\x00\xb4\x01\x5e\x00\x00\x00\xb4\x01\xbd\x00\x00\x00\xb4\x01\x00\x00\xb4\x01\xbb\x01\xb6\x01\xb5\x01\xb3\x01\xbd\x00\xb3\x01\x44\x00\x68\x01\xaf\x01\xad\x01\xa8\x01\xa8\x01\xa6\x01\x7c\x00\x9c\x01\xb7\x01\x9b\x01\x00\x00\x8b\x00\xb0\x01\x9a\x01\x00\x00\xb8\x01\x99\x01\x98\x01\x98\x01\x00\x00\x00\x00\x64\x00\x45\x00\x93\x01\x64\x00\x00\x00\x29\x00\xbd\x00\xbd\x00\xb2\x01\x8e\x01\x00\x00\x96\x01\x00\x00\xae\x01\x00\x00\x95\x01\x00\x00\x95\x01\x91\x01\xbd\x00\xab\x01\xb1\x01\x00\x00\xfe\xff\x00\x00\x6e\x00\x84\x01\xa9\x01\xa7\x01\xa7\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa5\x01\xac\x01\x07\x00\x07\x00\x00\x00\x8d\x01\x00\x00\x10\x01\x29\x00\x00\x00\x00\x00\x00\x00\x85\x01\xa3\x01\xaa\x01\x29\x00\x29\x00\x00\x00\x00\x00\x00\x00\x29\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa2\x01\x00\x00\x00\x00\x00\x00\x00\x00\x9d\x01\x00\x00\x00\x00\xa1\x01\x00\x00\x00\x00\xf6\xff\x80\x01\xbd\x00\x00\x00\x29\x00\x00\x00\x80\x01\x80\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x9e\x01\x7e\x01\x07\x00\x00\x00\xa4\x01\xa0\x01\x97\x01\x00\x00\xbc\x00\x00\x00\x8c\x01\x00\x00\xbc\x00\x00\x00\x78\x01\x94\x01\x9f\x01\x00\x00\x00\x00"#
-
-happyGotoOffsets :: HappyAddr
-happyGotoOffsets = HappyA# "\x86\x00\xa3\x00\xa1\x00\x58\x01\x6e\x01\x90\x01\x70\x01\x82\x01\x86\x01\x77\x01\x06\x00\x87\x01\x8f\x01\xb2\x00\x8b\x01\x48\x01\x74\x01\x0c\x00\x7f\x01\x30\x01\x4b\x01\x50\x01\x05\x01\xf6\x00\xc7\x00\x3c\x01\x31\x00\x3e\x01\xc0\x00\xb0\x00\x46\x00\xaa\x00\x23\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1c\x00\x00\x00\x00\x00\x00\x00\x9e\x00\x92\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x8a\x01\x00\x00\x00\x00\x00\x00\x1c\x00\x00\x00\x00\x00\xde\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2b\x01\xd9\x00\x00\x00\x00\x00\x00\x00\xfb\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x7a\x01\x6b\x01\x28\x01\x00\x00\x00\x00\x00\x00\x00\x00\x88\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x09\x01\x00\x00\x00\x00\x83\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x73\x01\x5d\x01\x56\x01\x61\x01\x22\x00\x72\x01\xc5\x00\x00\x00\x46\x01\x1d\x01\xfe\x00\x0b\x01\xde\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x09\x00\x00\x00\x00\x00\x00\x00\x00\x00\x5e\x01\x91\x00\x04\x00\x67\x01\x00\x00\x9a\x00\x35\x01\x0a\x01\x00\x00\xee\x00\x00\x00\x79\x00\x00\x00\x00\x00\x00\x00\xe9\x00\xfc\xff\xe0\x00\xce\x00\xe7\x00\x00\x00\xfd\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7d\x00\x00\x00\x88\x01\x24\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x26\x01\xd4\x00\x00\x00\x4b\x00\x37\x01\x00\x00\x39\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x17\x00\x1c\x00\x00\x00\x00\x00\x00\x00\x1c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\xcf\x00\x02\x00\x00\x00\x96\x00\x42\x00\xb5\x00\x4e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x8e\x00\x21\x01\x94\x00\x00\x00\x00\x00\x00\x00\x00\x00\xde\x00\x00\x00\xec\xff\x13\x00\xde\x00\x00\x00\x72\x00\x00\x00\x00\x00\x00\x00\x00\x00"#
-
-happyDefActions :: HappyAddr
-happyDefActions = HappyA# "\xd5\xff\x00\x00\xd5\xff\xd1\xff\xd1\xff\xce\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xad\xff\xaa\xff\x00\x00\xa5\xff\x00\x00\xa1\xff\x00\x00\x00\x00\x00\x00\x00\x00\x92\xff\x00\x00\xce\xff\xce\xff\x89\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xde\xff\x75\xff\x00\x00\xdd\xff\x7f\xff\x84\xff\x76\xff\x87\xff\x00\x00\x00\x00\x00\x00\x78\xff\x7c\xff\x80\xff\x7b\xff\x79\xff\x7a\xff\x00\x00\xdb\xff\x00\x00\x00\x00\x00\x00\x00\x00\x8a\xff\x8b\xff\x00\x00\x00\x00\x8d\xff\x8f\xff\x00\x00\x98\xff\x9b\xff\x9a\xff\x99\xff\x97\xff\x91\xff\x9e\xff\x9c\xff\x00\x00\x00\x00\x92\xff\xdc\xff\xda\xff\x9b\xff\x94\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa2\xff\x00\x00\x00\x00\x00\x00\x00\x00\xa7\xff\x00\x00\x00\x00\xa9\xff\x00\x00\xad\xff\xac\xff\x00\x00\x00\x00\x00\x00\xb4\xff\x00\x00\x00\x00\x00\x00\xb3\xff\x00\x00\xb8\xff\xb9\xff\x00\x00\x00\x00\xbc\xff\x00\x00\xbb\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x89\xff\x89\xff\x00\x00\x00\x00\x00\x00\xd0\xff\x00\x00\xd2\xff\xb4\xff\xd4\xff\x00\x00\xd8\xff\x00\x00\x00\x00\x00\x00\x00\x00\xd9\xff\xd6\xff\x00\x00\xd5\xff\x00\x00\xd1\xff\xcd\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xbf\xff\x00\x00\xbd\xff\x00\x00\xc6\xff\x00\x00\xa1\xff\xcb\xff\x00\x00\x00\x00\x00\x00\xb5\xff\xb7\xff\x00\x00\xb2\xff\x00\x00\xad\xff\x00\x00\xaa\xff\xaa\xff\xa6\xff\xa4\xff\xa3\xff\xa0\xff\x93\xff\x00\x00\x00\x00\x00\x00\x92\xff\x9d\xff\x00\x00\xce\xff\x88\xff\x00\x00\x83\xff\x82\xff\x81\xff\x00\x00\x00\x00\x00\x00\x00\x00\x85\xff\x77\xff\x7e\xff\x7d\xff\x86\xff\x8c\xff\x8e\xff\x90\xff\x9f\xff\x95\xff\x96\xff\x00\x00\xa8\xff\xae\xff\xab\xff\xb1\xff\x00\x00\xb6\xff\xba\xff\x00\x00\xc2\xff\xca\xff\x00\x00\x00\x00\x00\x00\xbe\xff\x00\x00\xce\xff\x00\x00\x00\x00\xc8\xff\xcf\xff\x74\xff\xd3\xff\xd7\xff\xc4\xff\xc5\xff\xc1\xff\xc7\xff\x00\x00\xa5\xff\x00\x00\xce\xff\x00\x00\x00\x00\x00\x00\xb0\xff\xcc\xff\xc0\xff\x89\xff\xce\xff\xc9\xff\xc3\xff\xad\xff\x00\x00\x00\x00\xaf\xff"#
-
-happyCheck :: HappyAddr
-happyCheck = HappyA# "\xff\xff\x0b\x00\x01\x00\x01\x00\x01\x00\x01\x00\x08\x00\x01\x00\x01\x00\x27\x00\x01\x00\x0d\x00\x20\x00\x01\x00\x0d\x00\x0d\x00\x2e\x00\x10\x00\x01\x00\x17\x00\x0d\x00\x0f\x00\x15\x00\x06\x00\x17\x00\x16\x00\x03\x00\x1a\x00\x1b\x00\x0a\x00\x0d\x00\x03\x00\x2a\x00\x10\x00\x16\x00\x01\x00\x01\x00\x24\x00\x15\x00\x26\x00\x17\x00\x25\x00\x01\x00\x1a\x00\x1b\x00\x2c\x00\x25\x00\x2e\x00\x29\x00\x2a\x00\x2b\x00\x2c\x00\x2d\x00\x24\x00\x0d\x00\x26\x00\x21\x00\x10\x00\x23\x00\x0a\x00\x03\x00\x2c\x00\x15\x00\x23\x00\x17\x00\x03\x00\x04\x00\x1a\x00\x1b\x00\x01\x00\x01\x00\x25\x00\x25\x00\x03\x00\x0c\x00\x00\x00\x0a\x00\x24\x00\x00\x00\x26\x00\x1f\x00\x0d\x00\x0d\x00\x0f\x00\x0f\x00\x2c\x00\x11\x00\x12\x00\x13\x00\x14\x00\x21\x00\x16\x00\x23\x00\x18\x00\x19\x00\x01\x00\x1e\x00\x1f\x00\x1d\x00\x1e\x00\x1f\x00\x01\x00\x21\x00\x22\x00\x1d\x00\x23\x00\x25\x00\x0d\x00\x2e\x00\x0f\x00\x2a\x00\x2a\x00\x02\x00\x0d\x00\x01\x00\x0f\x00\x02\x00\x11\x00\x12\x00\x13\x00\x14\x00\x00\x00\x16\x00\x0d\x00\x18\x00\x19\x00\x0d\x00\x02\x00\x0f\x00\x1d\x00\x1e\x00\x1f\x00\x12\x00\x21\x00\x22\x00\x01\x00\x2a\x00\x0d\x00\x02\x00\x05\x00\x06\x00\x07\x00\x2a\x00\x12\x00\x05\x00\x0b\x00\x01\x00\x08\x00\x0e\x00\x0f\x00\x1d\x00\x06\x00\x07\x00\x03\x00\x12\x00\x2a\x00\x0b\x00\x03\x00\x0a\x00\x0e\x00\x0f\x00\x03\x00\x01\x00\x15\x00\x01\x00\x29\x00\x2a\x00\x06\x00\x07\x00\x06\x00\x2e\x00\x25\x00\x0b\x00\x03\x00\x0b\x00\x0e\x00\x0f\x00\x0e\x00\x0f\x00\x03\x00\x02\x00\x00\x00\x25\x00\x21\x00\x22\x00\x23\x00\x24\x00\x21\x00\x22\x00\x23\x00\x24\x00\x21\x00\x22\x00\x23\x00\x24\x00\x03\x00\x12\x00\x00\x00\x25\x00\x00\x00\x25\x00\x0d\x00\x0d\x00\x21\x00\x22\x00\x23\x00\x24\x00\x00\x00\x02\x00\x21\x00\x22\x00\x23\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x00\x00\x01\x00\x00\x00\x21\x00\x1d\x00\x23\x00\x1d\x00\x29\x00\x2a\x00\x2a\x00\x01\x00\x00\x00\x0c\x00\x0d\x00\x18\x00\x19\x00\x1a\x00\x01\x00\x1c\x00\x18\x00\x19\x00\x1a\x00\x0d\x00\x1c\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x01\x00\x01\x00\x01\x00\x10\x00\x18\x00\x19\x00\x1a\x00\x14\x00\x1c\x00\x03\x00\x04\x00\x1a\x00\x1b\x00\x0d\x00\x0f\x00\x10\x00\x1a\x00\x1b\x00\x0c\x00\x14\x00\x20\x00\x1a\x00\x1b\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x11\x00\x01\x00\x13\x00\x10\x00\x18\x00\x19\x00\x1a\x00\x14\x00\x20\x00\x18\x00\x19\x00\x1a\x00\x0a\x00\x0d\x00\x18\x00\x19\x00\x1a\x00\x0a\x00\x01\x00\x18\x00\x19\x00\x1a\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x1e\x00\x1f\x00\x01\x00\x10\x00\x01\x00\x1e\x00\x1f\x00\x14\x00\x00\x00\x20\x00\x01\x00\x08\x00\x09\x00\x01\x00\x0b\x00\x19\x00\x1a\x00\x0e\x00\x0f\x00\x01\x00\x0b\x00\x1a\x00\x00\x00\x0e\x00\x0f\x00\x0d\x00\x01\x00\x09\x00\x01\x00\x0b\x00\x01\x00\x01\x00\x0e\x00\x0f\x00\x09\x00\x01\x00\x0b\x00\x00\x00\x0b\x00\x0e\x00\x0f\x00\x0e\x00\x0f\x00\x0e\x00\x0f\x00\x00\x00\x01\x00\x01\x00\x0e\x00\x0f\x00\x01\x00\x20\x00\x15\x00\x00\x00\x23\x00\x03\x00\x04\x00\x0c\x00\x0d\x00\x0d\x00\x29\x00\x00\x00\x0d\x00\x2a\x00\x0c\x00\x17\x00\x10\x00\x2e\x00\x11\x00\x0a\x00\x13\x00\x11\x00\x1f\x00\x13\x00\x21\x00\x11\x00\x02\x00\x0e\x00\x2b\x00\x0d\x00\x05\x00\x02\x00\x09\x00\x1c\x00\x29\x00\x09\x00\x0e\x00\x02\x00\x28\x00\x02\x00\x2b\x00\x0e\x00\x0e\x00\x01\x00\x0e\x00\x0d\x00\x07\x00\x29\x00\x0e\x00\x2a\x00\x0e\x00\x0a\x00\x09\x00\x2b\x00\x2a\x00\x29\x00\x29\x00\x08\x00\x0a\x00\x07\x00\x2a\x00\x1c\x00\x08\x00\x2e\x00\x0e\x00\x2e\x00\x2e\x00\x2e\x00\x05\x00\x05\x00\x0d\x00\x01\x00\xff\xff\x2a\x00\x22\x00\x08\x00\x05\x00\x05\x00\xff\xff\x05\x00\x2a\x00\x01\x00\xff\xff\xff\xff\x01\x00\xff\xff\x2a\x00\x29\x00\xff\xff\x2a\x00\xff\xff\x2e\x00\x0d\x00\xff\xff\xff\xff\x0d\x00\x2b\x00\x2e\x00\xff\xff\x29\x00\x27\x00\x2e\x00\x2e\x00\xff\xff\x1c\x00\x2e\x00\x2e\x00\x29\x00\x2e\x00\xff\xff\x29\x00\x2e\x00\x27\x00\xff\xff\x2e\x00\xff\xff\xff\xff\x2a\x00\x29\x00\xff\xff\x2a\x00\xff\xff\xff\xff\xff\xff\x2b\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"#
-
-happyTable :: HappyAddr
-happyTable = HappyA# "\x00\x00\xea\x00\x2c\x00\x6a\x00\x54\x00\x23\x00\xa7\x00\x63\x00\x4a\x00\xb9\x00\x23\x00\xab\x00\xf4\x00\x54\x00\x2d\x00\xe7\x00\xff\xff\x2e\x00\x2c\x00\xd6\x00\x4b\x00\x64\x00\x2f\x00\xc0\x00\x30\x00\xae\x00\x26\x00\x31\x00\x32\x00\xf3\x00\x2d\x00\x26\x00\x26\x00\x2e\x00\x55\x00\x23\x00\x23\x00\x33\x00\x2f\x00\x34\x00\x30\x00\xe0\x00\x2c\x00\x31\x00\x32\x00\x35\x00\x8c\x00\xff\xff\x23\x00\x26\x00\x4c\x00\x35\x00\x4d\x00\x33\x00\x2d\x00\x34\x00\xc0\x00\x2e\x00\x29\x00\x3a\x00\x26\x00\x35\x00\x2f\x00\xb7\x00\x30\x00\xba\x00\xbb\x00\x31\x00\x32\x00\x66\x00\x66\x00\x9b\x00\x24\x00\x26\x00\xbc\x00\x3e\x00\x3a\x00\x33\x00\xe3\x00\x34\x00\x3b\x00\x67\x00\x67\x00\x68\x00\x68\x00\x35\x00\x73\x00\x74\x00\x75\x00\x76\x00\xc4\x00\x77\x00\x29\x00\x78\x00\x79\x00\xa5\x00\xe5\x00\x3d\x00\x7a\x00\x7b\x00\x7c\x00\x66\x00\x7d\x00\x7e\x00\xc6\x00\x35\x00\x89\x00\x67\x00\xff\xff\x68\x00\x26\x00\x26\x00\xd0\x00\x67\x00\x66\x00\x68\x00\x5f\x00\x73\x00\x74\x00\x75\x00\x76\x00\x3e\x00\x77\x00\xd1\x00\x78\x00\x79\x00\x67\x00\x5f\x00\x68\x00\x7a\x00\x7b\x00\x7c\x00\xf6\x00\x7d\x00\x7e\x00\x83\x00\x26\x00\x6d\x00\x5f\x00\x8a\x00\x84\x00\x8b\x00\x26\x00\xce\x00\x90\x00\x86\x00\x83\x00\x75\xff\x71\x00\x69\x00\xd9\x00\x84\x00\xe1\x00\x26\x00\xa8\x00\x26\x00\x86\x00\x26\x00\xef\x00\x71\x00\x69\x00\x26\x00\x83\x00\xf1\x00\x83\x00\x23\x00\x26\x00\x84\x00\x85\x00\x89\x00\xff\xff\x87\x00\x86\x00\x26\x00\x86\x00\x71\x00\x69\x00\x71\x00\x69\x00\x26\x00\x5f\x00\xe4\x00\x87\x00\x27\x00\x28\x00\x29\x00\xe6\x00\x27\x00\x28\x00\x29\x00\xde\x00\x27\x00\x28\x00\x29\x00\xbe\x00\x26\x00\x60\x00\x3e\x00\x87\x00\x3e\x00\x87\x00\x6d\x00\x6d\x00\x27\x00\x28\x00\x29\x00\x2a\x00\xe8\x00\xd4\x00\x27\x00\x36\x00\x29\x00\x40\x00\x41\x00\x42\x00\x43\x00\x44\x00\x40\x00\x41\x00\x42\x00\x43\x00\x44\x00\x6d\x00\x6a\x00\xd5\x00\x37\x00\x97\x00\x29\x00\x3f\x00\x23\x00\x26\x00\x26\x00\x6a\x00\xd7\x00\x91\x00\x6f\x00\x45\x00\x46\x00\x47\x00\xda\x00\xc7\x00\x45\x00\x46\x00\x47\x00\xd3\x00\xb0\x00\x40\x00\x41\x00\x42\x00\x43\x00\x44\x00\x40\x00\x4d\x00\x42\x00\x43\x00\x44\x00\x40\x00\x4d\x00\x42\x00\x43\x00\x44\x00\x40\x00\x4d\x00\x42\x00\x43\x00\x44\x00\x63\x00\x6a\x00\x92\x00\x59\x00\x45\x00\x46\x00\x47\x00\xd1\x00\x48\x00\xba\x00\xbb\x00\x4e\x00\xaf\x00\xdc\x00\xa2\x00\x59\x00\x4e\x00\xb4\x00\xbc\x00\xa3\x00\x93\x00\x4e\x00\x4f\x00\x40\x00\x41\x00\x42\x00\x43\x00\x44\x00\x40\x00\x41\x00\x42\x00\x43\x00\x44\x00\x40\x00\x41\x00\x42\x00\x43\x00\x44\x00\x40\x00\x41\x00\x42\x00\x43\x00\x44\x00\x5c\x00\x6a\x00\xcb\x00\x59\x00\xf0\x00\x46\x00\x47\x00\xab\x00\x94\x00\xc8\x00\x46\x00\x47\x00\x3a\x00\xdd\x00\xb1\x00\x46\x00\x47\x00\x3a\x00\x95\x00\x52\x00\x46\x00\x47\x00\x40\x00\x41\x00\x42\x00\x43\x00\x44\x00\x40\x00\x4d\x00\x42\x00\x43\x00\x44\x00\xc5\x00\x3d\x00\x9d\x00\x59\x00\x63\x00\x3c\x00\x3d\x00\x5a\x00\x9e\x00\x38\x00\x63\x00\x81\x00\x82\x00\x6a\x00\x80\x00\x51\x00\x47\x00\x71\x00\x69\x00\x63\x00\xe2\x00\x50\x00\xac\x00\x71\x00\x69\x00\x9c\x00\x63\x00\xdf\x00\x63\x00\x80\x00\x63\x00\x9f\x00\x71\x00\x69\x00\x7f\x00\x63\x00\x80\x00\xad\x00\x70\x00\x71\x00\x69\x00\x71\x00\x69\x00\x9a\x00\x69\x00\x6d\x00\x6a\x00\x6a\x00\x68\x00\x69\x00\x6a\x00\x99\x00\x56\x00\xbc\x00\x9a\x00\xba\x00\xbb\x00\x6e\x00\x6f\x00\xa1\x00\x23\x00\xbd\x00\x6b\x00\x26\x00\xbc\x00\x53\x00\x62\x00\xff\xff\x5c\x00\x7e\x00\xcc\x00\x5c\x00\x58\x00\x5d\x00\x59\x00\x61\x00\xf9\x00\xf8\x00\x4c\x00\xf6\x00\xee\x00\xef\x00\xf3\x00\x3a\x00\x23\x00\xeb\x00\xec\x00\xc2\x00\xc4\x00\xca\x00\x4c\x00\xed\x00\xc3\x00\x5c\x00\xcb\x00\x5f\x00\xd9\x00\x23\x00\xce\x00\x26\x00\xd3\x00\x8f\x00\xdc\x00\x4c\x00\x26\x00\x23\x00\x23\x00\x8e\x00\x91\x00\xa1\x00\x26\x00\x3a\x00\xa7\x00\xff\xff\xa6\x00\xff\xff\xff\xff\xff\xff\xa8\x00\xaa\x00\xab\x00\x5c\x00\x00\x00\x26\x00\x97\x00\xb3\x00\xb4\x00\xb6\x00\x00\x00\x90\x00\x26\x00\x5c\x00\x00\x00\x00\x00\x5c\x00\x00\x00\x26\x00\x23\x00\x00\x00\x26\x00\x00\x00\xff\xff\x5f\x00\x00\x00\x00\x00\x5f\x00\x4c\x00\xff\xff\x00\x00\x23\x00\xb7\x00\xff\xff\xff\xff\x00\x00\x3a\x00\xff\xff\xff\xff\x23\x00\xff\xff\x00\x00\x23\x00\xff\xff\xb9\x00\x00\x00\xff\xff\x00\x00\x00\x00\x26\x00\x23\x00\x00\x00\x26\x00\x00\x00\x00\x00\x00\x00\x4c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"#
-
-happyReduceArr = Happy_Data_Array.array (33, 139) [
-	(33 , happyReduce_33),
-	(34 , happyReduce_34),
-	(35 , happyReduce_35),
-	(36 , happyReduce_36),
-	(37 , happyReduce_37),
-	(38 , happyReduce_38),
-	(39 , happyReduce_39),
-	(40 , happyReduce_40),
-	(41 , happyReduce_41),
-	(42 , happyReduce_42),
-	(43 , happyReduce_43),
-	(44 , happyReduce_44),
-	(45 , happyReduce_45),
-	(46 , happyReduce_46),
-	(47 , happyReduce_47),
-	(48 , happyReduce_48),
-	(49 , happyReduce_49),
-	(50 , happyReduce_50),
-	(51 , happyReduce_51),
-	(52 , happyReduce_52),
-	(53 , happyReduce_53),
-	(54 , happyReduce_54),
-	(55 , happyReduce_55),
-	(56 , happyReduce_56),
-	(57 , happyReduce_57),
-	(58 , happyReduce_58),
-	(59 , happyReduce_59),
-	(60 , happyReduce_60),
-	(61 , happyReduce_61),
-	(62 , happyReduce_62),
-	(63 , happyReduce_63),
-	(64 , happyReduce_64),
-	(65 , happyReduce_65),
-	(66 , happyReduce_66),
-	(67 , happyReduce_67),
-	(68 , happyReduce_68),
-	(69 , happyReduce_69),
-	(70 , happyReduce_70),
-	(71 , happyReduce_71),
-	(72 , happyReduce_72),
-	(73 , happyReduce_73),
-	(74 , happyReduce_74),
-	(75 , happyReduce_75),
-	(76 , happyReduce_76),
-	(77 , happyReduce_77),
-	(78 , happyReduce_78),
-	(79 , happyReduce_79),
-	(80 , happyReduce_80),
-	(81 , happyReduce_81),
-	(82 , happyReduce_82),
-	(83 , happyReduce_83),
-	(84 , happyReduce_84),
-	(85 , happyReduce_85),
-	(86 , happyReduce_86),
-	(87 , happyReduce_87),
-	(88 , happyReduce_88),
-	(89 , happyReduce_89),
-	(90 , happyReduce_90),
-	(91 , happyReduce_91),
-	(92 , happyReduce_92),
-	(93 , happyReduce_93),
-	(94 , happyReduce_94),
-	(95 , happyReduce_95),
-	(96 , happyReduce_96),
-	(97 , happyReduce_97),
-	(98 , happyReduce_98),
-	(99 , happyReduce_99),
-	(100 , happyReduce_100),
-	(101 , happyReduce_101),
-	(102 , happyReduce_102),
-	(103 , happyReduce_103),
-	(104 , happyReduce_104),
-	(105 , happyReduce_105),
-	(106 , happyReduce_106),
-	(107 , happyReduce_107),
-	(108 , happyReduce_108),
-	(109 , happyReduce_109),
-	(110 , happyReduce_110),
-	(111 , happyReduce_111),
-	(112 , happyReduce_112),
-	(113 , happyReduce_113),
-	(114 , happyReduce_114),
-	(115 , happyReduce_115),
-	(116 , happyReduce_116),
-	(117 , happyReduce_117),
-	(118 , happyReduce_118),
-	(119 , happyReduce_119),
-	(120 , happyReduce_120),
-	(121 , happyReduce_121),
-	(122 , happyReduce_122),
-	(123 , happyReduce_123),
-	(124 , happyReduce_124),
-	(125 , happyReduce_125),
-	(126 , happyReduce_126),
-	(127 , happyReduce_127),
-	(128 , happyReduce_128),
-	(129 , happyReduce_129),
-	(130 , happyReduce_130),
-	(131 , happyReduce_131),
-	(132 , happyReduce_132),
-	(133 , happyReduce_133),
-	(134 , happyReduce_134),
-	(135 , happyReduce_135),
-	(136 , happyReduce_136),
-	(137 , happyReduce_137),
-	(138 , happyReduce_138),
-	(139 , happyReduce_139)
-	]
-
-happy_n_terms = 47 :: Int
-happy_n_nonterms = 38 :: Int
-
-happyReduce_33 = happySpecReduce_1  0# happyReduction_33
-happyReduction_33 happy_x_1
-	 =  case happyOutTok happy_x_1 of { (PT _ (TL happy_var_1)) -> 
-	happyIn36
-		 (happy_var_1
-	)}
-
-happyReduce_34 = happySpecReduce_1  1# happyReduction_34
-happyReduction_34 happy_x_1
-	 =  case happyOutTok happy_x_1 of { (PT _ (TV happy_var_1)) -> 
-	happyIn37
-		 (Ident happy_var_1
-	)}
-
-happyReduce_35 = happySpecReduce_1  2# happyReduction_35
-happyReduction_35 happy_x_1
-	 =  case happyOutTok happy_x_1 of { (PT _ (TI happy_var_1)) -> 
-	happyIn38
-		 ((read ( happy_var_1)) :: Integer
-	)}
-
-happyReduce_36 = happySpecReduce_1  3# happyReduction_36
-happyReduction_36 happy_x_1
-	 =  case happyOutTok happy_x_1 of { (PT _ (TC happy_var_1)) -> 
-	happyIn39
-		 ((read ( happy_var_1)) :: Char
-	)}
-
-happyReduce_37 = happySpecReduce_1  4# happyReduction_37
-happyReduction_37 happy_x_1
-	 =  case happyOutTok happy_x_1 of { (PT _ (TD happy_var_1)) -> 
-	happyIn40
-		 ((read ( happy_var_1)) :: Double
-	)}
-
-happyReduce_38 = happySpecReduce_1  5# happyReduction_38
-happyReduction_38 happy_x_1
-	 =  case happyOut43 happy_x_1 of { happy_var_1 -> 
-	happyIn41
-		 (LGr happy_var_1
-	)}
-
-happyReduce_39 = happySpecReduce_1  6# happyReduction_39
-happyReduction_39 happy_x_1
-	 =  case happyOut47 happy_x_1 of { happy_var_1 -> 
-	happyIn42
-		 (DefAll happy_var_1
-	)}
-
-happyReduce_40 = happySpecReduce_3  6# happyReduction_40
-happyReduction_40 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut73 happy_x_1 of { happy_var_1 -> 
-	case happyOut47 happy_x_3 of { happy_var_3 -> 
-	happyIn42
-		 (DefSome happy_var_1 happy_var_3
-	)}}
-
-happyReduce_41 = happySpecReduce_2  6# happyReduction_41
-happyReduction_41 happy_x_2
-	happy_x_1
-	 =  case happyOut73 happy_x_2 of { happy_var_2 -> 
-	happyIn42
-		 (LDefView happy_var_2
-	)}
-
-happyReduce_42 = happySpecReduce_0  7# happyReduction_42
-happyReduction_42  =  happyIn43
-		 ([]
-	)
-
-happyReduce_43 = happySpecReduce_1  7# happyReduction_43
-happyReduction_43 happy_x_1
-	 =  case happyOut42 happy_x_1 of { happy_var_1 -> 
-	happyIn43
-		 ((:[]) happy_var_1
-	)}
-
-happyReduce_44 = happySpecReduce_3  7# happyReduction_44
-happyReduction_44 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut42 happy_x_1 of { happy_var_1 -> 
-	case happyOut43 happy_x_3 of { happy_var_3 -> 
-	happyIn43
-		 ((:) happy_var_1 happy_var_3
-	)}}
-
-happyReduce_45 = happySpecReduce_1  8# happyReduction_45
-happyReduction_45 happy_x_1
-	 =  case happyOut45 happy_x_1 of { happy_var_1 -> 
-	happyIn44
-		 (Grammar happy_var_1
-	)}
-
-happyReduce_46 = happySpecReduce_0  9# happyReduction_46
-happyReduction_46  =  happyIn45
-		 ([]
-	)
-
-happyReduce_47 = happySpecReduce_1  9# happyReduction_47
-happyReduction_47 happy_x_1
-	 =  case happyOut47 happy_x_1 of { happy_var_1 -> 
-	happyIn45
-		 ((:[]) happy_var_1
-	)}
-
-happyReduce_48 = happySpecReduce_3  9# happyReduction_48
-happyReduction_48 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut47 happy_x_1 of { happy_var_1 -> 
-	case happyOut45 happy_x_3 of { happy_var_3 -> 
-	happyIn45
-		 ((:) happy_var_1 happy_var_3
-	)}}
-
-happyReduce_49 = happySpecReduce_0  10# happyReduction_49
-happyReduction_49  =  happyIn46
-		 ([]
-	)
-
-happyReduce_50 = happySpecReduce_2  10# happyReduction_50
-happyReduction_50 happy_x_2
-	happy_x_1
-	 =  case happyOut46 happy_x_1 of { happy_var_1 -> 
-	case happyOut48 happy_x_2 of { happy_var_2 -> 
-	happyIn46
-		 (flip (:) happy_var_1 happy_var_2
-	)}}
-
-happyReduce_51 = happyReduce 5# 11# happyReduction_51
-happyReduction_51 (happy_x_5 `HappyStk`
-	happy_x_4 `HappyStk`
-	happy_x_3 `HappyStk`
-	happy_x_2 `HappyStk`
-	happy_x_1 `HappyStk`
-	happyRest)
-	 = case happyOut50 happy_x_1 of { happy_var_1 -> 
-	case happyOut49 happy_x_3 of { happy_var_3 -> 
-	case happyOut46 happy_x_5 of { happy_var_5 -> 
-	happyIn47
-		 (Rule happy_var_1 happy_var_3 (reverse happy_var_5)
-	) `HappyStk` happyRest}}}
-
-happyReduce_52 = happySpecReduce_2  11# happyReduction_52
-happyReduction_52 happy_x_2
-	happy_x_1
-	 =  case happyOut36 happy_x_2 of { happy_var_2 -> 
-	happyIn47
-		 (Comment happy_var_2
-	)}
-
-happyReduce_53 = happySpecReduce_3  11# happyReduction_53
-happyReduction_53 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut36 happy_x_2 of { happy_var_2 -> 
-	case happyOut36 happy_x_3 of { happy_var_3 -> 
-	happyIn47
-		 (Comments happy_var_2 happy_var_3
-	)}}
-
-happyReduce_54 = happyReduce 6# 11# happyReduction_54
-happyReduction_54 (happy_x_6 `HappyStk`
-	happy_x_5 `HappyStk`
-	happy_x_4 `HappyStk`
-	happy_x_3 `HappyStk`
-	happy_x_2 `HappyStk`
-	happy_x_1 `HappyStk`
-	happyRest)
-	 = case happyOut50 happy_x_2 of { happy_var_2 -> 
-	case happyOut49 happy_x_4 of { happy_var_4 -> 
-	case happyOut46 happy_x_6 of { happy_var_6 -> 
-	happyIn47
-		 (Internal happy_var_2 happy_var_4 (reverse happy_var_6)
-	) `HappyStk` happyRest}}}
-
-happyReduce_55 = happySpecReduce_3  11# happyReduction_55
-happyReduction_55 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut37 happy_x_2 of { happy_var_2 -> 
-	case happyOut72 happy_x_3 of { happy_var_3 -> 
-	happyIn47
-		 (Token happy_var_2 happy_var_3
-	)}}
-
-happyReduce_56 = happyReduce 4# 11# happyReduction_56
-happyReduction_56 (happy_x_4 `HappyStk`
-	happy_x_3 `HappyStk`
-	happy_x_2 `HappyStk`
-	happy_x_1 `HappyStk`
-	happyRest)
-	 = case happyOut37 happy_x_3 of { happy_var_3 -> 
-	case happyOut72 happy_x_4 of { happy_var_4 -> 
-	happyIn47
-		 (PosToken happy_var_3 happy_var_4
-	) `HappyStk` happyRest}}
-
-happyReduce_57 = happySpecReduce_2  11# happyReduction_57
-happyReduction_57 happy_x_2
-	happy_x_1
-	 =  case happyOut73 happy_x_2 of { happy_var_2 -> 
-	happyIn47
-		 (Entryp happy_var_2
-	)}
-
-happyReduce_58 = happyReduce 4# 11# happyReduction_58
-happyReduction_58 (happy_x_4 `HappyStk`
-	happy_x_3 `HappyStk`
-	happy_x_2 `HappyStk`
-	happy_x_1 `HappyStk`
-	happyRest)
-	 = case happyOut68 happy_x_2 of { happy_var_2 -> 
-	case happyOut49 happy_x_3 of { happy_var_3 -> 
-	case happyOut36 happy_x_4 of { happy_var_4 -> 
-	happyIn47
-		 (Separator happy_var_2 happy_var_3 happy_var_4
-	) `HappyStk` happyRest}}}
-
-happyReduce_59 = happyReduce 4# 11# happyReduction_59
-happyReduction_59 (happy_x_4 `HappyStk`
-	happy_x_3 `HappyStk`
-	happy_x_2 `HappyStk`
-	happy_x_1 `HappyStk`
-	happyRest)
-	 = case happyOut68 happy_x_2 of { happy_var_2 -> 
-	case happyOut49 happy_x_3 of { happy_var_3 -> 
-	case happyOut36 happy_x_4 of { happy_var_4 -> 
-	happyIn47
-		 (Terminator happy_var_2 happy_var_3 happy_var_4
-	) `HappyStk` happyRest}}}
-
-happyReduce_60 = happyReduce 6# 11# happyReduction_60
-happyReduction_60 (happy_x_6 `HappyStk`
-	happy_x_5 `HappyStk`
-	happy_x_4 `HappyStk`
-	happy_x_3 `HappyStk`
-	happy_x_2 `HappyStk`
-	happy_x_1 `HappyStk`
-	happyRest)
-	 = case happyOut49 happy_x_2 of { happy_var_2 -> 
-	case happyOut36 happy_x_3 of { happy_var_3 -> 
-	case happyOut36 happy_x_4 of { happy_var_4 -> 
-	case happyOut57 happy_x_5 of { happy_var_5 -> 
-	case happyOut68 happy_x_6 of { happy_var_6 -> 
-	happyIn47
-		 (Delimiters happy_var_2 happy_var_3 happy_var_4 happy_var_5 happy_var_6
-	) `HappyStk` happyRest}}}}}
-
-happyReduce_61 = happySpecReduce_3  11# happyReduction_61
-happyReduction_61 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut37 happy_x_2 of { happy_var_2 -> 
-	case happyOut38 happy_x_3 of { happy_var_3 -> 
-	happyIn47
-		 (Coercions happy_var_2 happy_var_3
-	)}}
-
-happyReduce_62 = happyReduce 4# 11# happyReduction_62
-happyReduction_62 (happy_x_4 `HappyStk`
-	happy_x_3 `HappyStk`
-	happy_x_2 `HappyStk`
-	happy_x_1 `HappyStk`
-	happyRest)
-	 = case happyOut37 happy_x_2 of { happy_var_2 -> 
-	case happyOut66 happy_x_4 of { happy_var_4 -> 
-	happyIn47
-		 (Rules happy_var_2 happy_var_4
-	) `HappyStk` happyRest}}
-
-happyReduce_63 = happyReduce 5# 11# happyReduction_63
-happyReduction_63 (happy_x_5 `HappyStk`
-	happy_x_4 `HappyStk`
-	happy_x_3 `HappyStk`
-	happy_x_2 `HappyStk`
-	happy_x_1 `HappyStk`
-	happyRest)
-	 = case happyOut37 happy_x_2 of { happy_var_2 -> 
-	case happyOut59 happy_x_3 of { happy_var_3 -> 
-	case happyOut60 happy_x_5 of { happy_var_5 -> 
-	happyIn47
-		 (Function happy_var_2 (reverse happy_var_3) happy_var_5
-	) `HappyStk` happyRest}}}
-
-happyReduce_64 = happySpecReduce_2  11# happyReduction_64
-happyReduction_64 happy_x_2
-	happy_x_1
-	 =  case happyOut65 happy_x_2 of { happy_var_2 -> 
-	happyIn47
-		 (Layout happy_var_2
-	)}
-
-happyReduce_65 = happySpecReduce_3  11# happyReduction_65
-happyReduction_65 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut65 happy_x_3 of { happy_var_3 -> 
-	happyIn47
-		 (LayoutStop happy_var_3
-	)}
-
-happyReduce_66 = happySpecReduce_2  11# happyReduction_66
-happyReduction_66 happy_x_2
-	happy_x_1
-	 =  happyIn47
-		 (LayoutTop
-	)
-
-happyReduce_67 = happySpecReduce_1  12# happyReduction_67
-happyReduction_67 happy_x_1
-	 =  case happyOut36 happy_x_1 of { happy_var_1 -> 
-	happyIn48
-		 (Terminal happy_var_1
-	)}
-
-happyReduce_68 = happySpecReduce_1  12# happyReduction_68
-happyReduction_68 happy_x_1
-	 =  case happyOut49 happy_x_1 of { happy_var_1 -> 
-	happyIn48
-		 (NTerminal happy_var_1
-	)}
-
-happyReduce_69 = happySpecReduce_3  13# happyReduction_69
-happyReduction_69 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut49 happy_x_2 of { happy_var_2 -> 
-	happyIn49
-		 (ListCat happy_var_2
-	)}
-
-happyReduce_70 = happySpecReduce_1  13# happyReduction_70
-happyReduction_70 happy_x_1
-	 =  case happyOut37 happy_x_1 of { happy_var_1 -> 
-	happyIn49
-		 (IdCat happy_var_1
-	)}
-
-happyReduce_71 = happySpecReduce_1  14# happyReduction_71
-happyReduction_71 happy_x_1
-	 =  case happyOut51 happy_x_1 of { happy_var_1 -> 
-	happyIn50
-		 (LabNoP happy_var_1
-	)}
-
-happyReduce_72 = happySpecReduce_2  14# happyReduction_72
-happyReduction_72 happy_x_2
-	happy_x_1
-	 =  case happyOut51 happy_x_1 of { happy_var_1 -> 
-	case happyOut56 happy_x_2 of { happy_var_2 -> 
-	happyIn50
-		 (LabP happy_var_1 happy_var_2
-	)}}
-
-happyReduce_73 = happySpecReduce_3  14# happyReduction_73
-happyReduction_73 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut51 happy_x_1 of { happy_var_1 -> 
-	case happyOut51 happy_x_2 of { happy_var_2 -> 
-	case happyOut56 happy_x_3 of { happy_var_3 -> 
-	happyIn50
-		 (LabPF happy_var_1 happy_var_2 happy_var_3
-	)}}}
-
-happyReduce_74 = happySpecReduce_2  14# happyReduction_74
-happyReduction_74 happy_x_2
-	happy_x_1
-	 =  case happyOut51 happy_x_1 of { happy_var_1 -> 
-	case happyOut51 happy_x_2 of { happy_var_2 -> 
-	happyIn50
-		 (LabF happy_var_1 happy_var_2
-	)}}
-
-happyReduce_75 = happySpecReduce_1  15# happyReduction_75
-happyReduction_75 happy_x_1
-	 =  case happyOut37 happy_x_1 of { happy_var_1 -> 
-	happyIn51
-		 (Id happy_var_1
-	)}
-
-happyReduce_76 = happySpecReduce_1  15# happyReduction_76
-happyReduction_76 happy_x_1
-	 =  happyIn51
-		 (Wild
-	)
-
-happyReduce_77 = happySpecReduce_2  15# happyReduction_77
-happyReduction_77 happy_x_2
-	happy_x_1
-	 =  happyIn51
-		 (ListE
-	)
-
-happyReduce_78 = happySpecReduce_3  15# happyReduction_78
-happyReduction_78 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  happyIn51
-		 (ListCons
-	)
-
-happyReduce_79 = happyReduce 5# 15# happyReduction_79
-happyReduction_79 (happy_x_5 `HappyStk`
-	happy_x_4 `HappyStk`
-	happy_x_3 `HappyStk`
-	happy_x_2 `HappyStk`
-	happy_x_1 `HappyStk`
-	happyRest)
-	 = happyIn51
-		 (ListOne
-	) `HappyStk` happyRest
-
-happyReduce_80 = happyReduce 9# 16# happyReduction_80
-happyReduction_80 (happy_x_9 `HappyStk`
-	happy_x_8 `HappyStk`
-	happy_x_7 `HappyStk`
-	happy_x_6 `HappyStk`
-	happy_x_5 `HappyStk`
-	happy_x_4 `HappyStk`
-	happy_x_3 `HappyStk`
-	happy_x_2 `HappyStk`
-	happy_x_1 `HappyStk`
-	happyRest)
-	 = case happyOut55 happy_x_3 of { happy_var_3 -> 
-	case happyOut54 happy_x_7 of { happy_var_7 -> 
-	happyIn52
-		 (ProfIt happy_var_3 happy_var_7
-	) `HappyStk` happyRest}}
-
-happyReduce_81 = happySpecReduce_3  17# happyReduction_81
-happyReduction_81 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut54 happy_x_2 of { happy_var_2 -> 
-	happyIn53
-		 (Ints happy_var_2
-	)}
-
-happyReduce_82 = happySpecReduce_0  18# happyReduction_82
-happyReduction_82  =  happyIn54
-		 ([]
-	)
-
-happyReduce_83 = happySpecReduce_1  18# happyReduction_83
-happyReduction_83 happy_x_1
-	 =  case happyOut38 happy_x_1 of { happy_var_1 -> 
-	happyIn54
-		 ((:[]) happy_var_1
-	)}
-
-happyReduce_84 = happySpecReduce_3  18# happyReduction_84
-happyReduction_84 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut38 happy_x_1 of { happy_var_1 -> 
-	case happyOut54 happy_x_3 of { happy_var_3 -> 
-	happyIn54
-		 ((:) happy_var_1 happy_var_3
-	)}}
-
-happyReduce_85 = happySpecReduce_0  19# happyReduction_85
-happyReduction_85  =  happyIn55
-		 ([]
-	)
-
-happyReduce_86 = happySpecReduce_1  19# happyReduction_86
-happyReduction_86 happy_x_1
-	 =  case happyOut53 happy_x_1 of { happy_var_1 -> 
-	happyIn55
-		 ((:[]) happy_var_1
-	)}
-
-happyReduce_87 = happySpecReduce_3  19# happyReduction_87
-happyReduction_87 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut53 happy_x_1 of { happy_var_1 -> 
-	case happyOut55 happy_x_3 of { happy_var_3 -> 
-	happyIn55
-		 ((:) happy_var_1 happy_var_3
-	)}}
-
-happyReduce_88 = happySpecReduce_1  20# happyReduction_88
-happyReduction_88 happy_x_1
-	 =  case happyOut52 happy_x_1 of { happy_var_1 -> 
-	happyIn56
-		 ((:[]) happy_var_1
-	)}
-
-happyReduce_89 = happySpecReduce_2  20# happyReduction_89
-happyReduction_89 happy_x_2
-	happy_x_1
-	 =  case happyOut52 happy_x_1 of { happy_var_1 -> 
-	case happyOut56 happy_x_2 of { happy_var_2 -> 
-	happyIn56
-		 ((:) happy_var_1 happy_var_2
-	)}}
-
-happyReduce_90 = happySpecReduce_0  21# happyReduction_90
-happyReduction_90  =  happyIn57
-		 (SepNone
-	)
-
-happyReduce_91 = happySpecReduce_2  21# happyReduction_91
-happyReduction_91 happy_x_2
-	happy_x_1
-	 =  case happyOut36 happy_x_2 of { happy_var_2 -> 
-	happyIn57
-		 (SepTerm happy_var_2
-	)}
-
-happyReduce_92 = happySpecReduce_2  21# happyReduction_92
-happyReduction_92 happy_x_2
-	happy_x_1
-	 =  case happyOut36 happy_x_2 of { happy_var_2 -> 
-	happyIn57
-		 (SepSepar happy_var_2
-	)}
-
-happyReduce_93 = happySpecReduce_1  22# happyReduction_93
-happyReduction_93 happy_x_1
-	 =  case happyOut37 happy_x_1 of { happy_var_1 -> 
-	happyIn58
-		 (Arg happy_var_1
-	)}
-
-happyReduce_94 = happySpecReduce_0  23# happyReduction_94
-happyReduction_94  =  happyIn59
-		 ([]
-	)
-
-happyReduce_95 = happySpecReduce_2  23# happyReduction_95
-happyReduction_95 happy_x_2
-	happy_x_1
-	 =  case happyOut59 happy_x_1 of { happy_var_1 -> 
-	case happyOut58 happy_x_2 of { happy_var_2 -> 
-	happyIn59
-		 (flip (:) happy_var_1 happy_var_2
-	)}}
-
-happyReduce_96 = happySpecReduce_3  24# happyReduction_96
-happyReduction_96 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut61 happy_x_1 of { happy_var_1 -> 
-	case happyOut60 happy_x_3 of { happy_var_3 -> 
-	happyIn60
-		 (Cons happy_var_1 happy_var_3
-	)}}
-
-happyReduce_97 = happySpecReduce_1  24# happyReduction_97
-happyReduction_97 happy_x_1
-	 =  case happyOut61 happy_x_1 of { happy_var_1 -> 
-	happyIn60
-		 (happy_var_1
-	)}
-
-happyReduce_98 = happySpecReduce_2  25# happyReduction_98
-happyReduction_98 happy_x_2
-	happy_x_1
-	 =  case happyOut37 happy_x_1 of { happy_var_1 -> 
-	case happyOut63 happy_x_2 of { happy_var_2 -> 
-	happyIn61
-		 (App happy_var_1 happy_var_2
-	)}}
-
-happyReduce_99 = happySpecReduce_1  25# happyReduction_99
-happyReduction_99 happy_x_1
-	 =  case happyOut62 happy_x_1 of { happy_var_1 -> 
-	happyIn61
-		 (happy_var_1
-	)}
-
-happyReduce_100 = happySpecReduce_1  26# happyReduction_100
-happyReduction_100 happy_x_1
-	 =  case happyOut37 happy_x_1 of { happy_var_1 -> 
-	happyIn62
-		 (Var happy_var_1
-	)}
-
-happyReduce_101 = happySpecReduce_1  26# happyReduction_101
-happyReduction_101 happy_x_1
-	 =  case happyOut38 happy_x_1 of { happy_var_1 -> 
-	happyIn62
-		 (LitInt happy_var_1
-	)}
-
-happyReduce_102 = happySpecReduce_1  26# happyReduction_102
-happyReduction_102 happy_x_1
-	 =  case happyOut39 happy_x_1 of { happy_var_1 -> 
-	happyIn62
-		 (LitChar happy_var_1
-	)}
-
-happyReduce_103 = happySpecReduce_1  26# happyReduction_103
-happyReduction_103 happy_x_1
-	 =  case happyOut36 happy_x_1 of { happy_var_1 -> 
-	happyIn62
-		 (LitString happy_var_1
-	)}
-
-happyReduce_104 = happySpecReduce_1  26# happyReduction_104
-happyReduction_104 happy_x_1
-	 =  case happyOut40 happy_x_1 of { happy_var_1 -> 
-	happyIn62
-		 (LitDouble happy_var_1
-	)}
-
-happyReduce_105 = happySpecReduce_3  26# happyReduction_105
-happyReduction_105 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut64 happy_x_2 of { happy_var_2 -> 
-	happyIn62
-		 (List happy_var_2
-	)}
-
-happyReduce_106 = happySpecReduce_3  26# happyReduction_106
-happyReduction_106 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut60 happy_x_2 of { happy_var_2 -> 
-	happyIn62
-		 (happy_var_2
-	)}
-
-happyReduce_107 = happySpecReduce_1  27# happyReduction_107
-happyReduction_107 happy_x_1
-	 =  case happyOut62 happy_x_1 of { happy_var_1 -> 
-	happyIn63
-		 ((:[]) happy_var_1
-	)}
-
-happyReduce_108 = happySpecReduce_2  27# happyReduction_108
-happyReduction_108 happy_x_2
-	happy_x_1
-	 =  case happyOut62 happy_x_1 of { happy_var_1 -> 
-	case happyOut63 happy_x_2 of { happy_var_2 -> 
-	happyIn63
-		 ((:) happy_var_1 happy_var_2
-	)}}
-
-happyReduce_109 = happySpecReduce_0  28# happyReduction_109
-happyReduction_109  =  happyIn64
-		 ([]
-	)
-
-happyReduce_110 = happySpecReduce_1  28# happyReduction_110
-happyReduction_110 happy_x_1
-	 =  case happyOut60 happy_x_1 of { happy_var_1 -> 
-	happyIn64
-		 ((:[]) happy_var_1
-	)}
-
-happyReduce_111 = happySpecReduce_3  28# happyReduction_111
-happyReduction_111 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut60 happy_x_1 of { happy_var_1 -> 
-	case happyOut64 happy_x_3 of { happy_var_3 -> 
-	happyIn64
-		 ((:) happy_var_1 happy_var_3
-	)}}
-
-happyReduce_112 = happySpecReduce_1  29# happyReduction_112
-happyReduction_112 happy_x_1
-	 =  case happyOut36 happy_x_1 of { happy_var_1 -> 
-	happyIn65
-		 ((:[]) happy_var_1
-	)}
-
-happyReduce_113 = happySpecReduce_3  29# happyReduction_113
-happyReduction_113 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut36 happy_x_1 of { happy_var_1 -> 
-	case happyOut65 happy_x_3 of { happy_var_3 -> 
-	happyIn65
-		 ((:) happy_var_1 happy_var_3
-	)}}
-
-happyReduce_114 = happySpecReduce_1  30# happyReduction_114
-happyReduction_114 happy_x_1
-	 =  case happyOut67 happy_x_1 of { happy_var_1 -> 
-	happyIn66
-		 ((:[]) happy_var_1
-	)}
-
-happyReduce_115 = happySpecReduce_3  30# happyReduction_115
-happyReduction_115 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut67 happy_x_1 of { happy_var_1 -> 
-	case happyOut66 happy_x_3 of { happy_var_3 -> 
-	happyIn66
-		 ((:) happy_var_1 happy_var_3
-	)}}
-
-happyReduce_116 = happySpecReduce_1  31# happyReduction_116
-happyReduction_116 happy_x_1
-	 =  case happyOut46 happy_x_1 of { happy_var_1 -> 
-	happyIn67
-		 (RHS (reverse happy_var_1)
-	)}
-
-happyReduce_117 = happySpecReduce_1  32# happyReduction_117
-happyReduction_117 happy_x_1
-	 =  happyIn68
-		 (MNonempty
-	)
-
-happyReduce_118 = happySpecReduce_0  32# happyReduction_118
-happyReduction_118  =  happyIn68
-		 (MEmpty
-	)
-
-happyReduce_119 = happySpecReduce_2  33# happyReduction_119
-happyReduction_119 happy_x_2
-	happy_x_1
-	 =  case happyOut69 happy_x_1 of { happy_var_1 -> 
-	case happyOut71 happy_x_2 of { happy_var_2 -> 
-	happyIn69
-		 (RSeq happy_var_1 happy_var_2
-	)}}
-
-happyReduce_120 = happySpecReduce_1  33# happyReduction_120
-happyReduction_120 happy_x_1
-	 =  case happyOut71 happy_x_1 of { happy_var_1 -> 
-	happyIn69
-		 (happy_var_1
-	)}
-
-happyReduce_121 = happySpecReduce_3  34# happyReduction_121
-happyReduction_121 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut70 happy_x_1 of { happy_var_1 -> 
-	case happyOut69 happy_x_3 of { happy_var_3 -> 
-	happyIn70
-		 (RAlt happy_var_1 happy_var_3
-	)}}
-
-happyReduce_122 = happySpecReduce_3  34# happyReduction_122
-happyReduction_122 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut69 happy_x_1 of { happy_var_1 -> 
-	case happyOut69 happy_x_3 of { happy_var_3 -> 
-	happyIn70
-		 (RMinus happy_var_1 happy_var_3
-	)}}
-
-happyReduce_123 = happySpecReduce_1  34# happyReduction_123
-happyReduction_123 happy_x_1
-	 =  case happyOut69 happy_x_1 of { happy_var_1 -> 
-	happyIn70
-		 (happy_var_1
-	)}
-
-happyReduce_124 = happySpecReduce_2  35# happyReduction_124
-happyReduction_124 happy_x_2
-	happy_x_1
-	 =  case happyOut71 happy_x_1 of { happy_var_1 -> 
-	happyIn71
-		 (RStar happy_var_1
-	)}
-
-happyReduce_125 = happySpecReduce_2  35# happyReduction_125
-happyReduction_125 happy_x_2
-	happy_x_1
-	 =  case happyOut71 happy_x_1 of { happy_var_1 -> 
-	happyIn71
-		 (RPlus happy_var_1
-	)}
-
-happyReduce_126 = happySpecReduce_2  35# happyReduction_126
-happyReduction_126 happy_x_2
-	happy_x_1
-	 =  case happyOut71 happy_x_1 of { happy_var_1 -> 
-	happyIn71
-		 (ROpt happy_var_1
-	)}
-
-happyReduce_127 = happySpecReduce_1  35# happyReduction_127
-happyReduction_127 happy_x_1
-	 =  happyIn71
-		 (REps
-	)
-
-happyReduce_128 = happySpecReduce_1  35# happyReduction_128
-happyReduction_128 happy_x_1
-	 =  case happyOut39 happy_x_1 of { happy_var_1 -> 
-	happyIn71
-		 (RChar happy_var_1
-	)}
-
-happyReduce_129 = happySpecReduce_3  35# happyReduction_129
-happyReduction_129 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut36 happy_x_2 of { happy_var_2 -> 
-	happyIn71
-		 (RAlts happy_var_2
-	)}
-
-happyReduce_130 = happySpecReduce_3  35# happyReduction_130
-happyReduction_130 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut36 happy_x_2 of { happy_var_2 -> 
-	happyIn71
-		 (RSeqs happy_var_2
-	)}
-
-happyReduce_131 = happySpecReduce_1  35# happyReduction_131
-happyReduction_131 happy_x_1
-	 =  happyIn71
-		 (RDigit
-	)
-
-happyReduce_132 = happySpecReduce_1  35# happyReduction_132
-happyReduction_132 happy_x_1
-	 =  happyIn71
-		 (RLetter
-	)
-
-happyReduce_133 = happySpecReduce_1  35# happyReduction_133
-happyReduction_133 happy_x_1
-	 =  happyIn71
-		 (RUpper
-	)
-
-happyReduce_134 = happySpecReduce_1  35# happyReduction_134
-happyReduction_134 happy_x_1
-	 =  happyIn71
-		 (RLower
-	)
-
-happyReduce_135 = happySpecReduce_1  35# happyReduction_135
-happyReduction_135 happy_x_1
-	 =  happyIn71
-		 (RAny
-	)
-
-happyReduce_136 = happySpecReduce_3  35# happyReduction_136
-happyReduction_136 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut72 happy_x_2 of { happy_var_2 -> 
-	happyIn71
-		 (happy_var_2
-	)}
-
-happyReduce_137 = happySpecReduce_1  36# happyReduction_137
-happyReduction_137 happy_x_1
-	 =  case happyOut70 happy_x_1 of { happy_var_1 -> 
-	happyIn72
-		 (happy_var_1
-	)}
-
-happyReduce_138 = happySpecReduce_1  37# happyReduction_138
-happyReduction_138 happy_x_1
-	 =  case happyOut37 happy_x_1 of { happy_var_1 -> 
-	happyIn73
-		 ((:[]) happy_var_1
-	)}
-
-happyReduce_139 = happySpecReduce_3  37# happyReduction_139
-happyReduction_139 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut37 happy_x_1 of { happy_var_1 -> 
-	case happyOut73 happy_x_3 of { happy_var_3 -> 
-	happyIn73
-		 ((:) happy_var_1 happy_var_3
-	)}}
-
-happyNewToken action sts stk [] =
-	happyDoAction 46# notHappyAtAll action sts stk []
-
-happyNewToken action sts stk (tk:tks) =
-	let cont i = happyDoAction i tk action sts stk tks in
-	case tk of {
-	PT _ (TS _ 1) -> cont 1#;
-	PT _ (TS _ 2) -> cont 2#;
-	PT _ (TS _ 3) -> cont 3#;
-	PT _ (TS _ 4) -> cont 4#;
-	PT _ (TS _ 5) -> cont 5#;
-	PT _ (TS _ 6) -> cont 6#;
-	PT _ (TS _ 7) -> cont 7#;
-	PT _ (TS _ 8) -> cont 8#;
-	PT _ (TS _ 9) -> cont 9#;
-	PT _ (TS _ 10) -> cont 10#;
-	PT _ (TS _ 11) -> cont 11#;
-	PT _ (TS _ 12) -> cont 12#;
-	PT _ (TS _ 13) -> cont 13#;
-	PT _ (TS _ 14) -> cont 14#;
-	PT _ (TS _ 15) -> cont 15#;
-	PT _ (TS _ 16) -> cont 16#;
-	PT _ (TS _ 17) -> cont 17#;
-	PT _ (TS _ 18) -> cont 18#;
-	PT _ (TS _ 19) -> cont 19#;
-	PT _ (TS _ 20) -> cont 20#;
-	PT _ (TS _ 21) -> cont 21#;
-	PT _ (TS _ 22) -> cont 22#;
-	PT _ (TS _ 23) -> cont 23#;
-	PT _ (TS _ 24) -> cont 24#;
-	PT _ (TS _ 25) -> cont 25#;
-	PT _ (TS _ 26) -> cont 26#;
-	PT _ (TS _ 27) -> cont 27#;
-	PT _ (TS _ 28) -> cont 28#;
-	PT _ (TS _ 29) -> cont 29#;
-	PT _ (TS _ 30) -> cont 30#;
-	PT _ (TS _ 31) -> cont 31#;
-	PT _ (TS _ 32) -> cont 32#;
-	PT _ (TS _ 33) -> cont 33#;
-	PT _ (TS _ 34) -> cont 34#;
-	PT _ (TS _ 35) -> cont 35#;
-	PT _ (TS _ 36) -> cont 36#;
-	PT _ (TS _ 37) -> cont 37#;
-	PT _ (TS _ 38) -> cont 38#;
-	PT _ (TS _ 39) -> cont 39#;
-	PT _ (TS _ 40) -> cont 40#;
-	PT _ (TL happy_dollar_dollar) -> cont 41#;
-	PT _ (TV happy_dollar_dollar) -> cont 42#;
-	PT _ (TI happy_dollar_dollar) -> cont 43#;
-	PT _ (TC happy_dollar_dollar) -> cont 44#;
-	PT _ (TD happy_dollar_dollar) -> cont 45#;
-	_ -> happyError' (tk:tks)
-	}
-
-happyError_ 46# tk tks = happyError' tks
-happyError_ _ tk tks = happyError' (tk:tks)
-
-happyThen :: () => Err a -> (a -> Err b) -> Err b
-happyThen = (thenM)
-happyReturn :: () => a -> Err a
-happyReturn = (returnM)
-happyThen1 m k tks = (thenM) m (\a -> k a tks)
-happyReturn1 :: () => a -> b -> Err a
-happyReturn1 = \a tks -> (returnM) a
-happyError' :: () => [(Token)] -> Err a
-happyError' = happyError
-
-pLGrammar tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 0# tks) (\x -> happyReturn (happyOut41 x))
-
-pLDef tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 1# tks) (\x -> happyReturn (happyOut42 x))
-
-pListLDef tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 2# tks) (\x -> happyReturn (happyOut43 x))
-
-pGrammar tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 3# tks) (\x -> happyReturn (happyOut44 x))
-
-pListDef tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 4# tks) (\x -> happyReturn (happyOut45 x))
-
-pListItem tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 5# tks) (\x -> happyReturn (happyOut46 x))
-
-pDef tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 6# tks) (\x -> happyReturn (happyOut47 x))
-
-pItem tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 7# tks) (\x -> happyReturn (happyOut48 x))
-
-pCat tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 8# tks) (\x -> happyReturn (happyOut49 x))
-
-pLabel tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 9# tks) (\x -> happyReturn (happyOut50 x))
-
-pLabelId tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 10# tks) (\x -> happyReturn (happyOut51 x))
-
-pProfItem tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 11# tks) (\x -> happyReturn (happyOut52 x))
-
-pIntList tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 12# tks) (\x -> happyReturn (happyOut53 x))
-
-pListInteger tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 13# tks) (\x -> happyReturn (happyOut54 x))
-
-pListIntList tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 14# tks) (\x -> happyReturn (happyOut55 x))
-
-pListProfItem tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 15# tks) (\x -> happyReturn (happyOut56 x))
-
-pSeparation tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 16# tks) (\x -> happyReturn (happyOut57 x))
-
-pArg tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 17# tks) (\x -> happyReturn (happyOut58 x))
-
-pListArg tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 18# tks) (\x -> happyReturn (happyOut59 x))
-
-pExp tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 19# tks) (\x -> happyReturn (happyOut60 x))
-
-pExp1 tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 20# tks) (\x -> happyReturn (happyOut61 x))
-
-pExp2 tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 21# tks) (\x -> happyReturn (happyOut62 x))
-
-pListExp2 tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 22# tks) (\x -> happyReturn (happyOut63 x))
-
-pListExp tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 23# tks) (\x -> happyReturn (happyOut64 x))
-
-pListString tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 24# tks) (\x -> happyReturn (happyOut65 x))
-
-pListRHS tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 25# tks) (\x -> happyReturn (happyOut66 x))
-
-pRHS tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 26# tks) (\x -> happyReturn (happyOut67 x))
-
-pMinimumSize tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 27# tks) (\x -> happyReturn (happyOut68 x))
-
-pReg2 tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 28# tks) (\x -> happyReturn (happyOut69 x))
-
-pReg1 tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 29# tks) (\x -> happyReturn (happyOut70 x))
-
-pReg3 tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 30# tks) (\x -> happyReturn (happyOut71 x))
-
-pReg tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 31# tks) (\x -> happyReturn (happyOut72 x))
-
-pListIdent tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 32# tks) (\x -> happyReturn (happyOut73 x))
-
-happySeq = happyDontSeq
-
-
-returnM :: a -> Err a
-returnM = return
-
-thenM :: Err a -> (a -> Err b) -> Err b
-thenM = (>>=)
-
-happyError :: [Token] -> Err a
-happyError ts =
-  Bad $ "syntax error at " ++ tokenPos ts ++ 
-  case ts of
-    [] -> []
-    [Err _] -> " due to lexer error"
-    _ -> " before " ++ unwords (map (id . prToken) (take 4 ts))
-
-myLexer = tokens
-{-# LINE 1 "templates/GenericTemplate.hs" #-}
-{-# LINE 1 "templates/GenericTemplate.hs" #-}
-{-# LINE 1 "<built-in>" #-}
-{-# LINE 1 "<command-line>" #-}
-{-# LINE 10 "<command-line>" #-}
-# 1 "/usr/include/stdc-predef.h" 1 3 4
-
-# 17 "/usr/include/stdc-predef.h" 3 4
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-{-# LINE 10 "<command-line>" #-}
-{-# LINE 1 "templates/GenericTemplate.hs" #-}
--- Id: GenericTemplate.hs,v 1.26 2005/01/14 14:47:22 simonmar Exp 
-
-{-# LINE 13 "templates/GenericTemplate.hs" #-}
-
-
-
-
-
--- Do not remove this comment. Required to fix CPP parsing when using GCC and a clang-compiled alex.
-#if __GLASGOW_HASKELL__ > 706
-#define LT(n,m) ((Happy_GHC_Exts.tagToEnum# (n Happy_GHC_Exts.<# m)) :: Bool)
-#define GTE(n,m) ((Happy_GHC_Exts.tagToEnum# (n Happy_GHC_Exts.>=# m)) :: Bool)
-#define EQ(n,m) ((Happy_GHC_Exts.tagToEnum# (n Happy_GHC_Exts.==# m)) :: Bool)
-#else
-#define LT(n,m) (n Happy_GHC_Exts.<# m)
-#define GTE(n,m) (n Happy_GHC_Exts.>=# m)
-#define EQ(n,m) (n Happy_GHC_Exts.==# m)
-#endif
-{-# LINE 46 "templates/GenericTemplate.hs" #-}
-
-
-data Happy_IntList = HappyCons Happy_GHC_Exts.Int# Happy_IntList
-
-
-
-
-
-{-# LINE 67 "templates/GenericTemplate.hs" #-}
-
-{-# LINE 77 "templates/GenericTemplate.hs" #-}
-
-{-# LINE 86 "templates/GenericTemplate.hs" #-}
-
-infixr 9 `HappyStk`
-data HappyStk a = HappyStk a (HappyStk a)
-
------------------------------------------------------------------------------
--- starting the parse
-
-happyParse start_state = happyNewToken start_state notHappyAtAll notHappyAtAll
-
------------------------------------------------------------------------------
--- Accepting the parse
-
--- If the current token is 0#, it means we've just accepted a partial
--- parse (a %partial parser).  We must ignore the saved token on the top of
--- the stack in this case.
-happyAccept 0# tk st sts (_ `HappyStk` ans `HappyStk` _) =
-        happyReturn1 ans
-happyAccept j tk st sts (HappyStk ans _) = 
-        (happyTcHack j (happyTcHack st)) (happyReturn1 ans)
-
------------------------------------------------------------------------------
--- Arrays only: do the next action
-
-
-
-happyDoAction i tk st
-        = {- nothing -}
-
-
-          case action of
-                0#           -> {- nothing -}
-                                     happyFail i tk st
-                -1#          -> {- nothing -}
-                                     happyAccept i tk st
-                n | LT(n,(0# :: Happy_GHC_Exts.Int#)) -> {- nothing -}
-
-                                                   (happyReduceArr Happy_Data_Array.! rule) i tk st
-                                                   where rule = (Happy_GHC_Exts.I# ((Happy_GHC_Exts.negateInt# ((n Happy_GHC_Exts.+# (1# :: Happy_GHC_Exts.Int#))))))
-                n                 -> {- nothing -}
-
-
-                                     happyShift new_state i tk st
-                                     where new_state = (n Happy_GHC_Exts.-# (1# :: Happy_GHC_Exts.Int#))
-   where off    = indexShortOffAddr happyActOffsets st
-         off_i  = (off Happy_GHC_Exts.+# i)
-         check  = if GTE(off_i,(0# :: Happy_GHC_Exts.Int#))
-                  then EQ(indexShortOffAddr happyCheck off_i, i)
-                  else False
-         action
-          | check     = indexShortOffAddr happyTable off_i
-          | otherwise = indexShortOffAddr happyDefActions st
-
-
-indexShortOffAddr (HappyA# arr) off =
-        Happy_GHC_Exts.narrow16Int# i
-  where
-        i = Happy_GHC_Exts.word2Int# (Happy_GHC_Exts.or# (Happy_GHC_Exts.uncheckedShiftL# high 8#) low)
-        high = Happy_GHC_Exts.int2Word# (Happy_GHC_Exts.ord# (Happy_GHC_Exts.indexCharOffAddr# arr (off' Happy_GHC_Exts.+# 1#)))
-        low  = Happy_GHC_Exts.int2Word# (Happy_GHC_Exts.ord# (Happy_GHC_Exts.indexCharOffAddr# arr off'))
-        off' = off Happy_GHC_Exts.*# 2#
-
-
-
-
-
-data HappyAddr = HappyA# Happy_GHC_Exts.Addr#
-
-
-
-
------------------------------------------------------------------------------
--- HappyState data type (not arrays)
-
-{-# LINE 170 "templates/GenericTemplate.hs" #-}
-
------------------------------------------------------------------------------
--- Shifting a token
-
-happyShift new_state 0# tk st sts stk@(x `HappyStk` _) =
-     let i = (case Happy_GHC_Exts.unsafeCoerce# x of { (Happy_GHC_Exts.I# (i)) -> i }) in
---     trace "shifting the error token" $
-     happyDoAction i tk new_state (HappyCons (st) (sts)) (stk)
-
-happyShift new_state i tk st sts stk =
-     happyNewToken new_state (HappyCons (st) (sts)) ((happyInTok (tk))`HappyStk`stk)
-
--- happyReduce is specialised for the common cases.
-
-happySpecReduce_0 i fn 0# tk st sts stk
-     = happyFail 0# tk st sts stk
-happySpecReduce_0 nt fn j tk st@((action)) sts stk
-     = happyGoto nt j tk st (HappyCons (st) (sts)) (fn `HappyStk` stk)
-
-happySpecReduce_1 i fn 0# tk st sts stk
-     = happyFail 0# tk st sts stk
-happySpecReduce_1 nt fn j tk _ sts@((HappyCons (st@(action)) (_))) (v1`HappyStk`stk')
-     = let r = fn v1 in
-       happySeq r (happyGoto nt j tk st sts (r `HappyStk` stk'))
-
-happySpecReduce_2 i fn 0# tk st sts stk
-     = happyFail 0# tk st sts stk
-happySpecReduce_2 nt fn j tk _ (HappyCons (_) (sts@((HappyCons (st@(action)) (_))))) (v1`HappyStk`v2`HappyStk`stk')
-     = let r = fn v1 v2 in
-       happySeq r (happyGoto nt j tk st sts (r `HappyStk` stk'))
-
-happySpecReduce_3 i fn 0# tk st sts stk
-     = happyFail 0# tk st sts stk
-happySpecReduce_3 nt fn j tk _ (HappyCons (_) ((HappyCons (_) (sts@((HappyCons (st@(action)) (_))))))) (v1`HappyStk`v2`HappyStk`v3`HappyStk`stk')
-     = let r = fn v1 v2 v3 in
-       happySeq r (happyGoto nt j tk st sts (r `HappyStk` stk'))
-
-happyReduce k i fn 0# tk st sts stk
-     = happyFail 0# tk st sts stk
-happyReduce k nt fn j tk st sts stk
-     = case happyDrop (k Happy_GHC_Exts.-# (1# :: Happy_GHC_Exts.Int#)) sts of
-         sts1@((HappyCons (st1@(action)) (_))) ->
-                let r = fn stk in  -- it doesn't hurt to always seq here...
-                happyDoSeq r (happyGoto nt j tk st1 sts1 r)
-
-happyMonadReduce k nt fn 0# tk st sts stk
-     = happyFail 0# tk st sts stk
-happyMonadReduce k nt fn j tk st sts stk =
-      case happyDrop k (HappyCons (st) (sts)) of
-        sts1@((HappyCons (st1@(action)) (_))) ->
-          let drop_stk = happyDropStk k stk in
-          happyThen1 (fn stk tk) (\r -> happyGoto nt j tk st1 sts1 (r `HappyStk` drop_stk))
-
-happyMonad2Reduce k nt fn 0# tk st sts stk
-     = happyFail 0# tk st sts stk
-happyMonad2Reduce k nt fn j tk st sts stk =
-      case happyDrop k (HappyCons (st) (sts)) of
-        sts1@((HappyCons (st1@(action)) (_))) ->
-         let drop_stk = happyDropStk k stk
-
-             off = indexShortOffAddr happyGotoOffsets st1
-             off_i = (off Happy_GHC_Exts.+# nt)
-             new_state = indexShortOffAddr happyTable off_i
-
-
-
-          in
-          happyThen1 (fn stk tk) (\r -> happyNewToken new_state sts1 (r `HappyStk` drop_stk))
-
-happyDrop 0# l = l
-happyDrop n (HappyCons (_) (t)) = happyDrop (n Happy_GHC_Exts.-# (1# :: Happy_GHC_Exts.Int#)) t
-
-happyDropStk 0# l = l
-happyDropStk n (x `HappyStk` xs) = happyDropStk (n Happy_GHC_Exts.-# (1#::Happy_GHC_Exts.Int#)) xs
-
------------------------------------------------------------------------------
--- Moving to a new state after a reduction
-
-
-happyGoto nt j tk st = 
-   {- nothing -}
-   happyDoAction j tk new_state
-   where off = indexShortOffAddr happyGotoOffsets st
-         off_i = (off Happy_GHC_Exts.+# nt)
-         new_state = indexShortOffAddr happyTable off_i
-
-
-
-
------------------------------------------------------------------------------
--- Error recovery (0# is the error token)
-
--- parse error if we are in recovery and we fail again
-happyFail 0# tk old_st _ stk@(x `HappyStk` _) =
-     let i = (case Happy_GHC_Exts.unsafeCoerce# x of { (Happy_GHC_Exts.I# (i)) -> i }) in
---      trace "failing" $ 
-        happyError_ i tk
-
-{-  We don't need state discarding for our restricted implementation of
-    "error".  In fact, it can cause some bogus parses, so I've disabled it
-    for now --SDM
-
--- discard a state
-happyFail  0# tk old_st (HappyCons ((action)) (sts)) 
-                                                (saved_tok `HappyStk` _ `HappyStk` stk) =
---      trace ("discarding state, depth " ++ show (length stk))  $
-        happyDoAction 0# tk action sts ((saved_tok`HappyStk`stk))
--}
-
--- Enter error recovery: generate an error token,
---                       save the old token and carry on.
-happyFail  i tk (action) sts stk =
---      trace "entering error recovery" $
-        happyDoAction 0# tk action sts ( (Happy_GHC_Exts.unsafeCoerce# (Happy_GHC_Exts.I# (i))) `HappyStk` stk)
-
--- Internal happy errors:
-
-notHappyAtAll :: a
-notHappyAtAll = error "Internal Happy error\n"
-
------------------------------------------------------------------------------
--- Hack to get the typechecker to accept our action functions
-
-
-happyTcHack :: Happy_GHC_Exts.Int# -> a -> a
-happyTcHack x y = y
-{-# INLINE happyTcHack #-}
-
-
------------------------------------------------------------------------------
--- Seq-ing.  If the --strict flag is given, then Happy emits 
---      happySeq = happyDoSeq
--- otherwise it emits
---      happySeq = happyDontSeq
-
-happyDoSeq, happyDontSeq :: a -> b -> b
-happyDoSeq   a b = a `seq` b
-happyDontSeq a b = b
-
------------------------------------------------------------------------------
--- Don't inline any functions from the template.  GHC has a nasty habit
--- of deciding to inline happyGoto everywhere, which increases the size of
--- the generated parser quite a bit.
-
-
-{-# NOINLINE happyDoAction #-}
-{-# NOINLINE happyTable #-}
-{-# NOINLINE happyCheck #-}
-{-# NOINLINE happyActOffsets #-}
-{-# NOINLINE happyGotoOffsets #-}
-{-# NOINLINE happyDefActions #-}
-
-{-# NOINLINE happyShift #-}
-{-# NOINLINE happySpecReduce_0 #-}
-{-# NOINLINE happySpecReduce_1 #-}
-{-# NOINLINE happySpecReduce_2 #-}
-{-# NOINLINE happySpecReduce_3 #-}
-{-# NOINLINE happyReduce #-}
-{-# NOINLINE happyMonadReduce #-}
-{-# NOINLINE happyGoto #-}
-{-# NOINLINE happyFail #-}
-
--- end of Happy Template.
diff --git a/src/AbsBNF.hs b/src/AbsBNF.hs
--- a/src/AbsBNF.hs
+++ b/src/AbsBNF.hs
@@ -1,124 +1,102 @@
-
-
+{-# LANGUAGE DeriveDataTypeable #-}
+{-# LANGUAGE DeriveGeneric #-}
 module AbsBNF where
 
 -- Haskell module generated by the BNF converter
 
 
-
-
-newtype Ident = Ident String deriving (Eq,Ord,Show,Read)
-data LGrammar =
-   LGr [LDef]
-  deriving (Eq,Ord,Show,Read)
+import Data.Data (Data,Typeable)
+import GHC.Generics (Generic)
+newtype Ident = Ident String
+  deriving (Eq, Ord, Show, Read, Data, Typeable, Generic)
+data LGrammar = LGr [LDef]
+  deriving (Eq, Ord, Show, Read, Data, Typeable, Generic)
 
-data LDef =
-   DefAll Def
- | DefSome [Ident] Def
- | LDefView [Ident]
-  deriving (Eq,Ord,Show,Read)
+data LDef = DefAll Def | DefSome [Ident] Def | LDefView [Ident]
+  deriving (Eq, Ord, Show, Read, Data, Typeable, Generic)
 
-data Grammar =
-   Grammar [Def]
-  deriving (Eq,Ord,Show,Read)
+data Grammar = Grammar [Def]
+  deriving (Eq, Ord, Show, Read, Data, Typeable, Generic)
 
-data Def =
-   Rule Label Cat [Item]
- | Comment String
- | Comments String String
- | Internal Label Cat [Item]
- | Token Ident Reg
- | PosToken Ident Reg
- | Entryp [Ident]
- | Separator MinimumSize Cat String
- | Terminator MinimumSize Cat String
- | Delimiters Cat String String Separation MinimumSize
- | Coercions Ident Integer
- | Rules Ident [RHS]
- | Function Ident [Arg] Exp
- | Layout [String]
- | LayoutStop [String]
- | LayoutTop
-  deriving (Eq,Ord,Show,Read)
+data Def
+    = Rule Label Cat [Item]
+    | Comment String
+    | Comments String String
+    | Internal Label Cat [Item]
+    | Token Ident Reg
+    | PosToken Ident Reg
+    | Entryp [Ident]
+    | Separator MinimumSize Cat String
+    | Terminator MinimumSize Cat String
+    | Delimiters Cat String String Separation MinimumSize
+    | Coercions Ident Integer
+    | Rules Ident [RHS]
+    | Function Ident [Arg] Exp
+    | Layout [String]
+    | LayoutStop [String]
+    | LayoutTop
+  deriving (Eq, Ord, Show, Read, Data, Typeable, Generic)
 
-data Item =
-   Terminal String
- | NTerminal Cat
-  deriving (Eq,Ord,Show,Read)
+data Item = Terminal String | NTerminal Cat
+  deriving (Eq, Ord, Show, Read, Data, Typeable, Generic)
 
-data Cat =
-   ListCat Cat
- | IdCat Ident
-  deriving (Eq,Ord,Show,Read)
+data Cat = ListCat Cat | IdCat Ident
+  deriving (Eq, Ord, Show, Read, Data, Typeable, Generic)
 
-data Label =
-   LabNoP LabelId
- | LabP LabelId [ProfItem]
- | LabPF LabelId LabelId [ProfItem]
- | LabF LabelId LabelId
-  deriving (Eq,Ord,Show,Read)
+data Label
+    = LabNoP LabelId
+    | LabP LabelId [ProfItem]
+    | LabPF LabelId LabelId [ProfItem]
+    | LabF LabelId LabelId
+  deriving (Eq, Ord, Show, Read, Data, Typeable, Generic)
 
-data LabelId =
-   Id Ident
- | Wild
- | ListE
- | ListCons
- | ListOne
-  deriving (Eq,Ord,Show,Read)
+data LabelId = Id Ident | Wild | ListE | ListCons | ListOne
+  deriving (Eq, Ord, Show, Read, Data, Typeable, Generic)
 
-data ProfItem =
-   ProfIt [IntList] [Integer]
-  deriving (Eq,Ord,Show,Read)
+data ProfItem = ProfIt [IntList] [Integer]
+  deriving (Eq, Ord, Show, Read, Data, Typeable, Generic)
 
-data IntList =
-   Ints [Integer]
-  deriving (Eq,Ord,Show,Read)
+data IntList = Ints [Integer]
+  deriving (Eq, Ord, Show, Read, Data, Typeable, Generic)
 
-data Separation =
-   SepNone
- | SepTerm String
- | SepSepar String
-  deriving (Eq,Ord,Show,Read)
+data Arg = Arg Ident
+  deriving (Eq, Ord, Show, Read, Data, Typeable, Generic)
 
-data Arg =
-   Arg Ident
-  deriving (Eq,Ord,Show,Read)
+data Separation = SepNone | SepTerm String | SepSepar String
+  deriving (Eq, Ord, Show, Read, Data, Typeable, Generic)
 
-data Exp =
-   Cons Exp Exp
- | App Ident [Exp]
- | Var Ident
- | LitInt Integer
- | LitChar Char
- | LitString String
- | LitDouble Double
- | List [Exp]
-  deriving (Eq,Ord,Show,Read)
+data Exp
+    = Cons Exp Exp
+    | App Ident [Exp]
+    | Var Ident
+    | LitInt Integer
+    | LitChar Char
+    | LitString String
+    | LitDouble Double
+    | List [Exp]
+  deriving (Eq, Ord, Show, Read, Data, Typeable, Generic)
 
-data RHS =
-   RHS [Item]
-  deriving (Eq,Ord,Show,Read)
+data RHS = RHS [Item]
+  deriving (Eq, Ord, Show, Read, Data, Typeable, Generic)
 
-data MinimumSize =
-   MNonempty
- | MEmpty
-  deriving (Eq,Ord,Show,Read)
+data MinimumSize = MNonempty | MEmpty
+  deriving (Eq, Ord, Show, Read, Data, Typeable, Generic)
 
-data Reg =
-   RSeq Reg Reg
- | RAlt Reg Reg
- | RMinus Reg Reg
- | RStar Reg
- | RPlus Reg
- | ROpt Reg
- | REps
- | RChar Char
- | RAlts String
- | RSeqs String
- | RDigit
- | RLetter
- | RUpper
- | RLower
- | RAny
-  deriving (Eq,Ord,Show,Read)
+data Reg
+    = RSeq Reg Reg
+    | RAlt Reg Reg
+    | RMinus Reg Reg
+    | RStar Reg
+    | RPlus Reg
+    | ROpt Reg
+    | REps
+    | RChar Char
+    | RAlts String
+    | RSeqs String
+    | RDigit
+    | RLetter
+    | RUpper
+    | RLower
+    | RAny
+  deriving (Eq, Ord, Show, Read, Data, Typeable, Generic)
 
diff --git a/src/BNF.cf b/src/BNF.cf
--- a/src/BNF.cf
+++ b/src/BNF.cf
@@ -14,10 +14,10 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
--- A Grammar is a sequence of definitions
+-- Multi-view grammars (undocumented)
 
 LGr.      LGrammar ::= [LDef] ;
 
@@ -25,38 +25,53 @@
 DefSome.  LDef ::= [Ident] ":" Def ;
 LDefView. LDef ::= "views" [Ident] ;
 
-separator LDef ";" ;
+-- separator LDef ";" ;
+[].       [LDef] ::= ;
+(:[]).    [LDef] ::= LDef ;
+(:).      [LDef] ::= LDef ";" [LDef] ;
+-- extra semicolons allowed
+_.        [LDef] ::= ";" [LDef] ;
 
-Grammar . Grammar ::= [Def] ;
+separator nonempty Ident "," ;
 
-separator Def ";" ;
+-- A Grammar is a sequence of definitions
 
-[]  . [Item] ::= ;
-(:) . [Item] ::= Item [Item] ;
+Grammar . Grammar ::= [Def] ;
 
---The rules of the grammar
-Rule . Def ::= Label "." Cat "::=" [Item] ;
+-- separator Def ";" ;  -- Note: this still permits a final semicolon.
+[].       [Def] ::= ;
+(:[]).    [Def] ::= Def ;
+(:).      [Def] ::= Def ";" [Def] ;
+-- extra semicolons allowed
+_.        [Def] ::= ";" [Def] ;
 
+-- The rules of the grammar
+Rule .    Def ::= Label "." Cat "::=" [Item] ;
+
 -- Items
 Terminal  . Item ::= String ;
 NTerminal . Item ::= Cat ;
 
--- Categories
+terminator Item "" ;
+
+-- Categories (non-terminals)
 ListCat  . Cat ::= "[" Cat "]" ;
 IdCat    . Cat ::= Ident ;
 
--- labels with or without profiles
+-- Labels with or without profiles
 LabNoP   . Label ::= LabelId ;
 LabP     . Label ::= LabelId [ProfItem] ;
+-- A second label can be given in use of profiles and serves as
+-- ``original function name'' (undocumented feature).
 LabPF    . Label ::= LabelId LabelId [ProfItem] ;
 LabF     . Label ::= LabelId LabelId ;
 
 -- functional labels
-Id       . LabelId ::= Ident ; 
-Wild     . LabelId ::= "_" ; 
-ListE    . LabelId ::= "[" "]" ;
-ListCons . LabelId ::= "(" ":" ")" ; 
-ListOne  . LabelId ::= "(" ":" "[" "]" ")" ;
+Id       . LabelId ::= Ident               ;  -- AST constructor
+Wild     . LabelId ::= "_"                 ;  -- No AST constructor (embedding)
+ListE    . LabelId ::= "[" "]"             ;  -- Empty list
+ListCons . LabelId ::= "(" ":" ")"         ;  -- Cons
+ListOne  . LabelId ::= "(" ":" "[" "]" ")" ;  -- Singleton list
 
 -- profiles (= permutation and binding patterns)
 ProfIt   . ProfItem ::= "(" "[" [IntList] "]" "," "[" [Integer] "]" ")" ;
@@ -68,86 +83,79 @@
 terminator nonempty ProfItem "" ;
 
 -- Pragmas
-Comment  .  Def ::= "comment" String ;
-Comments .  Def ::= "comment" String String ;
-Internal .  Def ::= "internal" Label "." Cat "::=" [Item] ; 
-Token.      Def ::= "token" Ident Reg ;
-PosToken.   Def ::= "position" "token" Ident Reg ;
-Entryp.     Def ::= "entrypoints" [Ident] ;
-Separator.  Def ::= "separator" MinimumSize Cat String ;
-Terminator. Def ::= "terminator" MinimumSize Cat String ;
-Delimiters. Def ::= "delimiters" Cat String String Separation MinimumSize;
-Coercions.  Def ::= "coercions" Ident Integer ;
-Rules.      Def ::= "rules" Ident "::=" [RHS] ;
-Function.   Def ::= "define" Ident [Arg] "=" Exp ;
+Comment  .  Def ::= "comment"  String                     ; -- Line comment
+Comments .  Def ::= "comment"  String String              ; -- Block comment
+Internal .  Def ::= "internal" Label "." Cat "::=" [Item] ; -- No parsing, AST and printing only
+Token.      Def ::=            "token" Ident Reg          ; -- Lexer token
+PosToken.   Def ::= "position" "token" Ident Reg          ; -- Lexer token with position info
+Entryp.     Def ::= "entrypoints" [Ident]                 ; -- Names of parsers
+Separator.  Def ::= "separator"   MinimumSize Cat String  ; -- List
+Terminator. Def ::= "terminator"  MinimumSize Cat String  ; -- List
+Delimiters. Def ::= "delimiters"  Cat String String Separation MinimumSize;
+Coercions.  Def ::= "coercions"   Ident Integer           ; -- Embeddings and parenthesized exprs.
+Rules.      Def ::= "rules"       Ident "::=" [RHS]       ; -- Automatically generated lables (e.g. enums)
+Function.   Def ::= "define"      Ident [Arg] "=" Exp     ;
 
+Arg.        Arg ::= Ident ;
+separator   Arg "" ;
+
+-- Lists
 SepNone.    Separation ::= ;
 SepTerm.    Separation ::= "terminator" String;
-SepSepar.   Separation ::= "separator" String;
+SepSepar.   Separation ::= "separator"  String;
 
-Layout.     Def ::= "layout" [String] ;
-LayoutStop. Def ::= "layout" "stop" [String] ;
-LayoutTop.  Def ::= "layout" "toplevel" ;
+-- Layout
+Layout.     Def ::= "layout" [String]        ; -- Layout start keywords
+LayoutStop. Def ::= "layout" "stop" [String] ; -- Layout stop keywords
+LayoutTop.  Def ::= "layout" "toplevel"      ; -- Should the toplevel be a block?
 
-Arg. Arg ::= Ident ;
-separator Arg "" ;
+separator nonempty String "," ;
 
 -- Expressions
-Cons.	    Exp  ::= Exp1 ":" Exp ;
-App.	    Exp1 ::= Ident [Exp2] ;
-Var.	    Exp2 ::= Ident ;
-LitInt.	    Exp2 ::= Integer ;
+Cons.       Exp  ::= Exp1 ":" Exp ;
+App.        Exp1 ::= Ident [Exp2] ;
+Var.        Exp2 ::= Ident ;
+LitInt.     Exp2 ::= Integer ;
 LitChar.    Exp2 ::= Char ;
 LitString.  Exp2 ::= String ;
 LitDouble.  Exp2 ::= Double ;
-List.	    Exp2 ::= "[" [Exp] "]" ;
-
+List.       Exp2 ::= "[" [Exp] "]" ;
 
-coercions Exp 2;
-separator nonempty Exp2 "" ;
-separator Exp "," ;
+coercions   Exp 2;
 
-separator nonempty String "," ;
+separator   Exp ","        ; -- list list
+separator nonempty Exp2 "" ; -- argument list
 
+RHS.      RHS ::= [Item] ;
 separator nonempty RHS "|" ;
-RHS. RHS ::= [Item] ;
 
 -- List size condition
 MNonempty.  MinimumSize ::= "nonempty" ;
 MEmpty.     MinimumSize ::=  ;
 
--- regular expressions
-RSeq.   Reg2 ::= Reg2 Reg3 ;
-RAlt.   Reg1 ::= Reg1 "|" Reg2 ;
-RMinus. Reg1 ::= Reg2 "-" Reg2 ;
+-- Regular expressions
+RSeq.    Reg2 ::= Reg2 Reg3     ;  -- left-associative
+RAlt.    Reg1 ::= Reg1 "|" Reg2 ;  -- left-associative
+RMinus.  Reg1 ::= Reg2 "-" Reg2 ;  -- non-associative
 
-RStar.  Reg3 ::= Reg3 "*" ;
-RPlus.  Reg3 ::= Reg3 "+" ;
-ROpt.   Reg3 ::= Reg3 "?" ;
+RStar.   Reg3 ::= Reg3 "*" ;
+RPlus.   Reg3 ::= Reg3 "+" ;
+ROpt.    Reg3 ::= Reg3 "?" ;
 
-REps.   Reg3 ::= "eps" ;
+REps.    Reg3 ::= "eps" ;
 
-RChar.  Reg3 ::= Char ;           -- single character
-RAlts.  Reg3 ::= "[" String "]" ; -- list of alternative characters
-RSeqs.  Reg3 ::= "{" String "}" ; -- character sequence
+RChar.   Reg3 ::= Char ;           -- single character
+RAlts.   Reg3 ::= "[" String "]" ; -- list of alternative characters
+RSeqs.   Reg3 ::= "{" String "}" ; -- character sequence
 
-RDigit.  Reg3 ::= "digit" ;
+RDigit.  Reg3 ::= "digit"  ;
 RLetter. Reg3 ::= "letter" ;
-RUpper.  Reg3 ::= "upper" ;
-RLower.  Reg3 ::= "lower" ;
-RAny.    Reg3 ::= "char" ;
-
-_. Reg  ::= Reg1 ;
-_. Reg1 ::= Reg2 ;
-_. Reg2 ::= Reg3 ;
-_. Reg3 ::= "(" Reg ")" ;
+RUpper.  Reg3 ::= "upper"  ;
+RLower.  Reg3 ::= "lower"  ;
+RAny.    Reg3 ::= "char"   ;
 
--- list of categories in the entrypoint pragma
-(:[]).  [Ident] ::= Ident ;
-(:).    [Ident] ::= Ident "," [Ident] ;
+coercions Reg 3;
 
--- comments in BNF source
-comment "--" ;
+-- Comments in BNF source
+comment "--"      ;
 comment "{-" "-}" ;
-
-
diff --git a/src/BNFC/Backend/Base.hs b/src/BNFC/Backend/Base.hs
--- a/src/BNFC/Backend/Base.hs
+++ b/src/BNFC/Backend/Base.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE TypeSynonymInstances, FlexibleInstances #-}
 {- Backend base function. Defines the type of the backend and some usefull
  - functions -}
 module BNFC.Backend.Base
@@ -9,11 +10,13 @@
   , writeFiles
   ) where
 
-import BNFC.Utils (writeFileRep)
 import Control.Monad.Writer
 import System.Directory (createDirectoryIfMissing)
 import System.FilePath (dropFileName, (</>))
 
+import BNFC.PrettyPrint
+import BNFC.Utils (writeFileRep)
+
 -- | Define the type of the backend functions For more purity, instead of
 -- having each backend writing the generated files to disk, they return a list
 -- of pairs containing the (relative) file path and the file content. This
@@ -35,8 +38,20 @@
 
 -- | A specialized version of tell that adds a file and its content to the
 -- list of generated files
-mkfile :: FilePath -> String -> MkFiles ()
-mkfile path content = tell [(path,content)]
+mkfile :: (FileContent c) => FilePath -> c -> MkFiles ()
+mkfile path content = tell [(path, fileContentToString content)]
+
+-- | While we are moving to generating Text.PrettyPrint.Doc instead of String,
+-- it is nice to be able to use both as argument to mkfile
+-- So we do some typeclass magic
+class FileContent a where
+    fileContentToString :: a -> String
+
+instance FileContent [Char] where
+    fileContentToString = id
+
+instance FileContent Doc where
+    fileContentToString = render
 
 -- | Write a set of files to disk. the first argument is the root directory
 -- inside which all the generated files will be written. This root directory
diff --git a/src/BNFC/Backend/C.hs b/src/BNFC/Backend/C.hs
--- a/src/BNFC/Backend/C.hs
+++ b/src/BNFC/Backend/C.hs
@@ -1,3 +1,5 @@
+{-# LANGUAGE NoImplicitPrelude #-}
+
 {-
     BNF Converter: C Main file
     Copyright (C) 2004  Author:  Michael Pellauer
@@ -14,10 +16,12 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 module BNFC.Backend.C (makeC) where
 
+import Prelude'
+
 import BNFC.Utils
 import BNFC.CF
 import BNFC.Options
@@ -27,6 +31,7 @@
 import BNFC.Backend.C.CFtoBisonC
 import BNFC.Backend.C.CFtoCSkel
 import BNFC.Backend.C.CFtoCPrinter
+import BNFC.PrettyPrint
 import Data.Char
 import qualified BNFC.Backend.Common.Makefile as Makefile
 
@@ -59,46 +64,50 @@
         name = lang opts
 
 
-makefile :: String -> String -> String
-makefile name prefix =
-  (unlines [ "CC = gcc",
-             "CCFLAGS = -g -W -Wall", "",
-             "FLEX = flex",
-             "FLEX_OPTS = -P" ++ prefix, "",
-             "BISON = bison",
-             "BISON_OPTS = -t -p" ++ prefix, "",
-             "OBJS = Absyn.o Lexer.o Parser.o Printer.o", ""] ++)
-  $ Makefile.mkRule ".PHONY" ["clean", "distclean"]
-    []
-  $ Makefile.mkRule "all" [testName]
-    []
-  $ Makefile.mkRule "clean" []
-    -- peteg: don't nuke what we generated - move that to the "vclean" target.
-    [ "rm -f *.o " ++ testName ++ " " ++ unwords
-      [ name ++ e | e <- [".aux", ".log", ".pdf",".dvi", ".ps", ""]] ]
-  $ Makefile.mkRule "distclean" ["clean"]
-    [ "rm -f " ++ unwords
-      [ "Absyn.h", "Absyn.c", "Test.c", "Parser.c", "Parser.h", "Lexer.c",
-        "Skeleton.c", "Skeleton.h", "Printer.c", "Printer.h", "Makefile " ]
-      ++ name ++ ".l " ++ name ++ ".y " ++ name ++ ".tex "]
-  $ Makefile.mkRule testName ["${OBJS}", "Test.o"]
-    [ "@echo \"Linking " ++ testName ++ "...\""
-    , "${CC} ${CCFLAGS} ${OBJS} Test.o -o " ++ testName ]
-  $ Makefile.mkRule "Absyn.o" [ "Absyn.c", "Absyn.h"]
-    [ "${CC} ${CCFLAGS} -c Absyn.c" ]
-  $ Makefile.mkRule "Lexer.c" [ name ++ ".l" ]
-    [ "${FLEX} ${FLEX_OPTS} -oLexer.c " ++ name ++ ".l" ]
-  $ Makefile.mkRule "Parser.c" [ name ++ ".y" ]
-    [ "${BISON} ${BISON_OPTS} " ++ name ++ ".y -o Parser.c" ]
-  $ Makefile.mkRule "Lexer.o" [ "Lexer.c", "Parser.h" ]
-    [ "${CC} ${CCFLAGS} -c Lexer.c " ]
-  $ Makefile.mkRule "Parser.o" ["Parser.c", "Absyn.h" ]
-    [ "${CC} ${CCFLAGS} -c Parser.c" ]
-  $ Makefile.mkRule "Printer.o" [ "Printer.c", "Printer.h", "Absyn.h" ]
-    [ "${CC} ${CCFLAGS} -c Printer.c" ]
-  $ Makefile.mkRule "Test.o" [ "Test.c", "Parser.h", "Printer.h", "Absyn.h" ]
-    [ "${CC} ${CCFLAGS} -c Test.c" ]
-  ""
+makefile :: String -> String -> Doc
+makefile name prefix = vcat
+    [ "CC = gcc"
+    , "CCFLAGS = -g -W -Wall"
+    , ""
+    , "FLEX = flex"
+    , "FLEX_OPTS = -P" <> text prefix
+    , ""
+    , "BISON = bison"
+    , "BISON_OPTS = -t -p" <> text prefix
+    , ""
+    , "OBJS = Absyn.o Lexer.o Parser.o Printer.o"
+    , ""
+    , Makefile.mkRule ".PHONY" ["clean", "distclean"]
+      []
+    , Makefile.mkRule "all" [testName]
+      []
+    , Makefile.mkRule "clean" []
+      -- peteg: don't nuke what we generated - move that to the "vclean" target.
+      [ "rm -f *.o " ++ testName ++ " " ++ unwords
+        [ name ++ e | e <- [".aux", ".log", ".pdf",".dvi", ".ps", ""]] ]
+    , Makefile.mkRule "distclean" ["clean"]
+      [ "rm -f " ++ unwords
+        [ "Absyn.h", "Absyn.c", "Test.c", "Parser.c", "Parser.h", "Lexer.c",
+          "Skeleton.c", "Skeleton.h", "Printer.c", "Printer.h", "Makefile " ]
+        ++ name ++ ".l " ++ name ++ ".y " ++ name ++ ".tex "]
+    , Makefile.mkRule testName ["${OBJS}", "Test.o"]
+      [ "@echo \"Linking " ++ testName ++ "...\""
+      , "${CC} ${CCFLAGS} ${OBJS} Test.o -o " ++ testName ]
+    , Makefile.mkRule "Absyn.o" [ "Absyn.c", "Absyn.h"]
+      [ "${CC} ${CCFLAGS} -c Absyn.c" ]
+    , Makefile.mkRule "Lexer.c" [ name ++ ".l" ]
+      [ "${FLEX} ${FLEX_OPTS} -oLexer.c " ++ name ++ ".l" ]
+    , Makefile.mkRule "Parser.c" [ name ++ ".y" ]
+      [ "${BISON} ${BISON_OPTS} " ++ name ++ ".y -o Parser.c" ]
+    , Makefile.mkRule "Lexer.o" [ "Lexer.c", "Parser.h" ]
+      [ "${CC} ${CCFLAGS} -c Lexer.c " ]
+    , Makefile.mkRule "Parser.o" ["Parser.c", "Absyn.h" ]
+      [ "${CC} ${CCFLAGS} -c Parser.c" ]
+    , Makefile.mkRule "Printer.o" [ "Printer.c", "Printer.h", "Absyn.h" ]
+      [ "${CC} ${CCFLAGS} -c Printer.c" ]
+    , Makefile.mkRule "Test.o" [ "Test.c", "Parser.h", "Printer.h", "Absyn.h" ]
+      [ "${CC} ${CCFLAGS} -c Test.c" ]
+    ]
   where testName = "Test" ++ name
 
 -- | Generate a test program that parses stdin and prints the AST and it's
@@ -116,21 +125,46 @@
     "",
     "#include <stdio.h>",
     "#include <stdlib.h>",
+    "#include <string.h>",
     "",
     "#include \"Parser.h\"",
     "#include \"Printer.h\"",
     "#include \"Absyn.h\"",
     "",
+    "void usage(void) {",
+    "  printf(\"usage: Call with one of the following argument " ++
+      "combinations:\\n\");",
+    "  printf(\"\\t--help\\t\\tDisplay this help message.\\n\");",
+    "  printf(\"\\t(no arguments)\tParse stdin verbosely.\\n\");",
+    "  printf(\"\\t(files)\\t\\tParse content of files verbosely.\\n\");",
+    "  printf(\"\\t-s (files)\\tSilent mode. Parse content of files " ++
+      "silently.\\n\");",
+    "}",
+    "",
     "int main(int argc, char ** argv)",
     "{",
     "  FILE *input;",
     "  " ++ def ++ " parse_tree;",
-    "  if (argc > 1) ",
-    "  {",
-    "    input = fopen(argv[1], \"r\");",
-    "    if (!input)",
-    "    {",
-    "      fprintf(stderr, \"Error opening input file.\\n\");",
+    "  int quiet = 0;",
+    "  char *filename = NULL;",
+    "",
+    "  if (argc > 1) {",
+    "    if (strcmp(argv[1], \"-s\") == 0) {",
+    "      quiet = 1;",
+    "      if (argc > 2) {",
+    "        filename = argv[2];",
+    "      } else {",
+    "        input = stdin;",
+    "      }",
+    "    } else {",
+    "      filename = argv[1];",
+    "    }",
+    "  }",
+    "",
+    "  if (filename) {",
+    "    input = fopen(filename, \"r\");",
+    "    if (!input) {",
+    "      usage();",
     "      exit(1);",
     "    }",
     "  }",
@@ -140,10 +174,12 @@
     "  if (parse_tree)",
     "  {",
     "    printf(\"\\nParse Succesful!\\n\");",
-    "    printf(\"\\n[Abstract Syntax]\\n\");",
-    "    printf(\"%s\\n\\n\", show" ++ def ++ "(parse_tree));",
-    "    printf(\"[Linearized Tree]\\n\");",
-    "    printf(\"%s\\n\\n\", print" ++ def ++ "(parse_tree));",
+    "    if (!quiet) {",
+    "      printf(\"\\n[Abstract Syntax]\\n\");",
+    "      printf(\"%s\\n\\n\", show" ++ def ++ "(parse_tree));",
+    "      printf(\"[Linearized Tree]\\n\");",
+    "      printf(\"%s\\n\\n\", print" ++ def ++ "(parse_tree));",
+    "    }",
     "    return 0;",
     "  }",
     "  return 1;",
@@ -167,7 +203,7 @@
   "  char char_;",
   "  double double_;",
   "  char* string_;",
-  (concatMap mkVar cats) ++ "} YYSTYPE;",
+  concatMap mkVar cats ++ "} YYSTYPE;",
   "",
   "#define _ERROR_ 258",
   mkDefines (259::Int) env,
@@ -198,4 +234,3 @@
    else ""
   mkFunc s | normCat s == s = identCat s ++ " p" ++ identCat s ++ "(FILE *inp);\n"
   mkFunc _ = ""
-
diff --git a/src/BNFC/Backend/C/CFtoBisonC.hs b/src/BNFC/Backend/C/CFtoBisonC.hs
--- a/src/BNFC/Backend/C/CFtoBisonC.hs
+++ b/src/BNFC/Backend/C/CFtoBisonC.hs
@@ -14,7 +14,7 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 {-
@@ -84,11 +84,11 @@
           "#define initialize_lexer " ++ name ++ "_initialize_lexer",
           "extern int yyparse(void);",
           "extern int yylex(void);",
-          "int yy_mylinenumber;", 
+          "int yy_mylinenumber;",
           "extern int initialize_lexer(FILE * inp);",
           "void yyerror(const char *str)",
           "{",
-          "  extern char *" ++ name ++ "text;", 
+          "  extern char *" ++ name ++ "text;",
           "  fprintf(stderr,\"error: line %d: %s at %s\\n\",",
           "    yy_mylinenumber + 1, str, " ++ name ++ "text);",
           "}",
@@ -211,7 +211,7 @@
                  else (False,r0),
      let (p,m) = generatePatterns cf env r])
  where
-   revs = reversibleCats cf
+   revs = cfgReversibleCats cf
    eps = allEntryPoints cf
    isEntry nt = nt `elem` eps
    result = if isEntry nt then resultName (identCat (normCat nt)) ++ "= $$;" else ""
@@ -230,7 +230,7 @@
 -- >>> generateAction "ListFoo" "(:)" True ["$1","$2"]
 -- "make_ListFoo($2, $1);"
 generateAction :: String -> Fun -> Bool -> [MetaVar] -> Action
-generateAction nt f b ms 
+generateAction nt f b ms
   | isCoercion f = unwords ms ++ ";"
   | isNilFun f   = "0;"
   | isOneFun f   = concat ["make_", nt, "(", intercalate ", " ms', ", 0);"]
@@ -253,7 +253,7 @@
    revIf c m = if not (isConsFun (funRule r)) && elem c revs
                  then "reverse" ++ identCat (normCat c) ++ "(" ++ m ++ ")"
                else m  -- no reversal in the left-recursive Cons rule itself
-   revs = reversibleCats cf
+   revs = cfgReversibleCats cf
 
 -- We have now constructed the patterns and actions,
 -- so the only thing left is to merge them into one string.
diff --git a/src/BNFC/Backend/C/CFtoCAbs.hs b/src/BNFC/Backend/C/CFtoCAbs.hs
--- a/src/BNFC/Backend/C/CFtoCAbs.hs
+++ b/src/BNFC/Backend/C/CFtoCAbs.hs
@@ -1,3 +1,5 @@
+{-# LANGUAGE NoImplicitPrelude #-}
+
 {-
     BNF Converter: C Abstract syntax
     Copyright (C) 2004  Author:  Michael Pellauer
@@ -14,7 +16,7 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 {-
@@ -40,6 +42,7 @@
 
 module BNFC.Backend.C.CFtoCAbs (cf2CAbs) where
 
+import Prelude'
 
 import BNFC.CF
 import BNFC.PrettyPrint
@@ -85,7 +88,7 @@
      "typedef struct " ++ s ++ "_ *" ++ s ++ ";"
     ]
   prForward _ = ""
-  getRules cf = (map testRule (rulesOfCF cf))
+  getRules cf = (map testRule (cfgRules cf))
   getClasses = map show . filter (\c -> identCat (normCat c) == show c)
   testRule (Rule f c _) =
    if isList c
@@ -138,7 +141,7 @@
       show c ++ " make_" ++ fun ++ "(" ++ (prParamsH 0 (getVars cats)) ++ ");\n"
    where
      prParamsH :: Int -> [(String, a)] -> String
-     prParamsH _ [] = ""
+     prParamsH _ [] = "void"
      prParamsH n ((t,_):[]) = t ++ " p" ++ (show n)
      prParamsH n ((t,_):vs) = (t ++ " p" ++ (show n) ++ ", ") ++ (prParamsH (n+1) vs)
 
diff --git a/src/BNFC/Backend/C/CFtoCPrinter.hs b/src/BNFC/Backend/C/CFtoCPrinter.hs
--- a/src/BNFC/Backend/C/CFtoCPrinter.hs
+++ b/src/BNFC/Backend/C/CFtoCPrinter.hs
@@ -1,3 +1,5 @@
+{-# LANGUAGE NoImplicitPrelude #-}
+
 {-
     BNF Converter: C Pretty Printer printer
     Copyright (C) 2004  Author:  Michael Pellauer
@@ -14,7 +16,7 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 {-
@@ -41,18 +43,20 @@
 
 module BNFC.Backend.C.CFtoCPrinter (cf2CPrinter) where
 
+import Prelude'
+
 import BNFC.CF
 import BNFC.Utils ((+++))
 import BNFC.Backend.Common (renderListSepByPrecedence)
 import BNFC.Backend.Common.NamedVariables
 import BNFC.Backend.Common.StrUtils (renderCharOrString)
-import BNFC.Backend.Utils (isTokenType)
 import Data.List
 import Data.Char(toLower)
 import Data.Either (lefts)
 import BNFC.PrettyPrint
 
---Produces (.h file, .c file)
+-- | Produces (.h file, .c file).
+
 cf2CPrinter :: CF -> (String, String)
 cf2CPrinter cf = (mkHFile cf groups, mkCFile cf groups)
  where
@@ -60,7 +64,8 @@
 
 {- **** Header (.h) File Methods **** -}
 
---An extremely large function to make the Header File
+-- | An extremely large function to make the Header File.
+
 mkHFile :: CF -> [(Cat,[Rule])] -> String
 mkHFile cf groups = unlines
  [
@@ -73,11 +78,11 @@
  ]
  where
   eps = allEntryPoints cf
-  prPrints s | normCat s == s = "char* print" ++ s' ++ "(" ++ s' ++ " p);\n"
+  prPrints s | normCat s == s = "char *print" ++ s' ++ "(" ++ s' ++ " p);\n"
     where
       s' = identCat s
   prPrints _ = ""
-  prShows s | normCat s == s = "char* show" ++ s' ++ "(" ++ s' ++ " p);\n"
+  prShows s | normCat s == s = "char *show" ++ s' ++ "(" ++ s' ++ " p);\n"
     where
       s' = identCat s
   prShows _ = ""
@@ -118,7 +123,7 @@
     "void shChar(Char c);",
     "void shString(String s);",
     "void shIdent(String s);",
-    "void bufAppendS(const char* s);",
+    "void bufAppendS(const char *s);",
     "void bufAppendC(const char c);",
     "void bufReset(void);",
     "void resizeBuffer(void);",
@@ -126,13 +131,15 @@
     "#endif"
    ]
 
---Prints all the required method names and their parameters.
+-- | Prints all the required method names and their parameters.
+
 prPrintDataH :: (Cat, [Rule]) -> String
 prPrintDataH (cat, _) = concat ["void pp", cl, "(", cl, " p, int i);\n"]
   where
    cl = identCat (normCat cat)
 
---Prints all the required method names and their parameters.
+-- | Prints all the required method names and their parameters.
+
 prShowDataH :: (Cat, [Rule]) -> String
 prShowDataH (cat, _) = concat ["void sh", cl, "(", cl, " p);\n"]
   where
@@ -140,7 +147,8 @@
 
 {- **** Implementation (.C) File Methods **** -}
 
---This makes the .C file by a similar method.
+-- | This makes the .C file by a similar method.
+
 mkCFile :: CF -> [(Cat,[Rule])] -> String
 mkCFile cf groups = concat
    [
@@ -148,17 +156,16 @@
     prRender,
     concatMap prPrintFun eps,
     concatMap prShowFun eps,
-    concatMap (prPrintData user) groups,
+    concatMap prPrintData groups,
     printBasics,
     printTokens,
-    concatMap (prShowData user) groups,
+    concatMap prShowData groups,
     showBasics,
     showTokens,
     footer
    ]
   where
     eps = allEntryPoints cf
-    user = fst (unzip (tokenPragmas cf))
     header = unlines
      [
       "/*** BNFC-Generated Pretty Printer and Abstract Syntax Viewer ***/",
@@ -171,7 +178,7 @@
       "#define INDENT_WIDTH 2",
       "",
       "int _n_;",
-      "char* buf_;",
+      "char *buf_;",
       "int cur_;",
       "int buf_size;",
       ""
@@ -264,7 +271,7 @@
      ]
     footer = unlines
      [
-      "void bufAppendS(const char* s)",
+      "void bufAppendS(const char *s)",
       "{",
       "  int len = strlen(s);",
       "  int n;",
@@ -300,7 +307,7 @@
       "}",
       "void resizeBuffer(void)",
       "{",
-      "  char* temp = (char*) malloc(buf_size);",
+      "  char *temp = (char *) malloc(buf_size);",
       "  if (!temp)",
       "  {",
       "    fprintf(stderr, \"Error: Out of memory while attempting to grow buffer!\\n\");",
@@ -321,11 +328,12 @@
 
 {- **** Pretty Printer Methods **** -}
 
---An entry point to begin printing
+-- | An entry point to the printer.
+
 prPrintFun :: Cat -> String
 prPrintFun ep | normCat ep == ep = unlines
   [
-   "char* print" ++ ep' ++ "(" ++ ep' ++ " p)",
+   "char *print" ++ ep' ++ "(" ++ ep' ++ " p)",
    "{",
    "  _n_ = 0;",
    "  bufReset();",
@@ -337,15 +345,16 @@
   ep' = identCat ep
 prPrintFun _ = ""
 
---Generates methods for the Pretty Printer
-prPrintData :: [UserDef] -> (Cat, [Rule]) -> String
-prPrintData user (cat, rules) = unlines $
+-- Generates methods for the Pretty Printer
+
+prPrintData :: (Cat, [Rule]) -> String
+prPrintData (cat, rules) = unlines $
  if isList cat
  then
  [
   "void pp" ++ cl ++ "("++ cl +++ vname ++ ", int i)",
   "{",
-  "  while(" ++ vname ++ "!= 0)",
+  "  while(" ++ vname +++ "!= 0)",
   "  {",
   "    if (" ++ vname ++ "->" ++ vname ++ "_ == 0)",
   "    {",
@@ -370,7 +379,7 @@
    "{",
    "  switch(_p_->kind)",
    "  {",
-   concatMap (prPrintRule user) rules,
+   concatMap prPrintRule rules,
    "  default:",
    "    fprintf(stderr, \"Error: bad kind field when printing " ++ show cat ++ "!\\n\");",
    "    exit(1);",
@@ -394,14 +403,16 @@
 --
 -- >>> renderX "---"
 -- renderS("---")
+
 renderX :: String -> Doc
 renderX sep' = "render" <> char sc <> parens (text sep)
   where (sc, sep) = renderCharOrString sep'
 
 
---Pretty Printer methods for a rule.
-prPrintRule :: [UserDef] -> Rule -> String
-prPrintRule user r@(Rule fun _ cats) | not (isCoercion fun) = unlines
+-- | Pretty Printer methods for a rule.
+
+prPrintRule :: Rule -> String
+prPrintRule r@(Rule fun _ cats) | not (isCoercion fun) = unlines
   [
    "  case is_" ++ fun ++ ":",
    lparen,
@@ -414,14 +425,15 @@
     (lparen, rparen) =
       ("    if (_i_ > " ++ show p ++ ") renderC(_L_PAREN);",
        "    if (_i_ > " ++ show p ++ ") renderC(_R_PAREN);")
-    cats' = concatMap (prPrintCat user fun) (numVars cats)
-prPrintRule _ _ = ""
+    cats' = concatMap (prPrintCat fun) (numVars cats)
+prPrintRule _ = ""
 
---This goes on to recurse to the instance variables.
-prPrintCat :: [UserDef] -> String -> Either (Cat, Doc) String -> String
-prPrintCat user fnm (c) = case c of
+-- | This goes on to recurse to the instance variables.
+
+prPrintCat :: String -> Either (Cat, Doc) String -> String
+prPrintCat fnm (c) = case c of
   Right t -> "    " ++ render (renderX t) ++ ";\n"
-  Left (cat, nt) | isTokenType user cat -> "    pp" ++ basicFunName (render nt) ++ "(_p_->u." ++ v ++ "_." ++ render nt ++ ", " ++ show (precCat cat) ++ ");\n"
+  Left (cat, nt) | isTokenCat cat -> "    pp" ++ basicFunName (render nt) ++ "(_p_->u." ++ v ++ "_." ++ render nt ++ ", " ++ show (precCat cat) ++ ");\n"
   Left (InternalCat, _) -> "    /* Internal Category */\n"
   Left (cat, nt) -> "    pp" ++ identCat (normCat cat) ++ "(_p_->u." ++ v ++ "_." ++ render nt ++ ", " ++ show (precCat cat) ++ ");\n"
  where
@@ -429,11 +441,12 @@
 
 {- **** Abstract Syntax Tree Printer **** -}
 
---An entry point to begin printing
+-- | An entry point to the printer.
+
 prShowFun :: Cat -> String
 prShowFun ep | normCat ep == ep = unlines
   [
-   "char* show" ++ ep' ++ "(" ++ ep' ++ " p)",
+   "char *show" ++ ep' ++ "(" ++ ep' ++ " p)",
    "{",
    "  _n_ = 0;",
    "  bufReset();",
@@ -445,15 +458,17 @@
   ep' = identCat ep
 prShowFun _ = ""
 
---This prints the functions for Abstract Syntax tree printing.
-prShowData :: [UserDef] -> (Cat, [Rule]) -> String
-prShowData user (cat, rules) = unlines $
+-- | This prints the functions for Abstract Syntax tree printing.
+
+prShowData :: (Cat, [Rule]) -> String
+prShowData (cat, rules) = unlines $
  if isList cat
  then
  [
   "void sh" ++ cl ++ "("++ cl +++ vname ++ ")",
   "{",
-  "  while(" ++ vname ++ "!= 0)",
+  "  bufAppendC('[');",
+  "  while(" ++ vname +++ "!= 0)",
   "  {",
   "    if (" ++ vname ++ "->" ++ vname ++ "_)",
   "    {",
@@ -467,16 +482,17 @@
   "      " ++ vname ++ " = 0;",
   "    }",
   "  }",
+  "  bufAppendC(']');",
   "}",
   ""
- ] --Not a list:
+ ] -- Not a list:
  else
  [
    "void sh" ++ cl ++ "(" ++ cl ++ " _p_)",
    "{",
    "  switch(_p_->kind)",
    "  {",
-   concatMap (prShowRule user) rules,
+   concatMap prShowRule rules,
    "  default:",
    "    fprintf(stderr, \"Error: bad kind field when showing " ++ show cat ++ "!\\n\");",
    "    exit(1);",
@@ -490,17 +506,18 @@
    member = map toLower ecl
    visitMember = "      sh" ++ ecl ++ "(" ++ vname ++ "->" ++ member ++ "_);"
 
---Pretty Printer methods for a rule.
-prShowRule :: [UserDef] -> Rule -> String
-prShowRule user (Rule fun _ cats) | not (isCoercion fun) = unlines
+-- | Pretty Printer methods for a rule.
+
+prShowRule :: Rule -> String
+prShowRule (Rule fun _ cats) | not (isCoercion fun) = unlines
   [
    "  case is_" ++ fun ++ ":",
-   lparen,
+   "  " ++ lparen,
    "    bufAppendS(\"" ++ fun ++ "\");\n",
-   optspace,
+   "  " ++ optspace,
    cats',
-   rparen,
-   "    break;\n"
+   "  " ++ rparen,
+   "    break;"
   ]
    where
     (optspace, lparen, rparen) = if allTerms cats
@@ -508,7 +525,7 @@
       else ("  bufAppendC(' ');\n", "  bufAppendC('(');\n","  bufAppendC(')');\n")
     cats' = if allTerms cats
         then ""
-        else concat (insertSpaces (map (prShowCat user fun) (lefts $ numVars cats)))
+        else concat (insertSpaces (map (prShowCat fun) (lefts $ numVars cats)))
     insertSpaces [] = []
     insertSpaces (x:[]) = [x]
     insertSpaces (x:xs) = if x == ""
@@ -517,26 +534,23 @@
     allTerms [] = True
     allTerms (Left _:_) = False
     allTerms (_:zs) = allTerms zs
-prShowRule _ _ = ""
+prShowRule _ = ""
 
---This goes on to recurse to the instance variables.
-prShowCat :: [UserDef] -> Fun -> (Cat, Doc) -> String
-prShowCat user fnm c = case c of
-    (cat,nt) | isTokenType user cat ->
+-- | This goes on to recurse to the instance variables.
+
+prShowCat :: Fun -> (Cat, Doc) -> String
+prShowCat fnm c = case c of
+    (cat,nt) | isTokenCat cat ->
         "    sh" ++ basicFunName (render nt) ++ "(_p_->u." ++ v ++ "_." ++ render nt ++ ");\n"
     (InternalCat, _) -> "    /* Internal Category */\n"
-    (cat,nt) | show (normCat $ strToCat$ render nt) /= render nt ->
+    (cat,nt) ->
         "    sh" ++ identCat (normCat cat) ++ "(_p_->u." ++ v ++ "_." ++ render nt ++ ");\n"
-    (cat,nt) -> concat
-          [
-           "    bufAppendC('[');\n",
-           "    sh" ++ identCat (normCat cat) ++ "(_p_->u." ++ v ++ "_." ++ render nt ++ ");\n",
-           "    bufAppendC(']');\n"
-          ]
   where v = map toLower (normFun fnm)
 
 {- **** Helper Functions Section **** -}
---The visit-function name of a basic type
+
+-- | The visit-function name of a basic type.
+
 basicFunName :: String -> String
 basicFunName v
   | "integer_" `isPrefixOf` v = "Integer"
@@ -546,7 +560,8 @@
   | "ident_" `isPrefixOf` v   = "Ident"
   | otherwise = "Ident" --User-defined type
 
---An extremely simple renderCer for terminals.
+-- | An extremely simple @renderC@ for terminals.
+
 prRender :: String
 prRender = unlines
   [
diff --git a/src/BNFC/Backend/C/CFtoCSkel.hs b/src/BNFC/Backend/C/CFtoCSkel.hs
--- a/src/BNFC/Backend/C/CFtoCSkel.hs
+++ b/src/BNFC/Backend/C/CFtoCSkel.hs
@@ -1,3 +1,5 @@
+{-# LANGUAGE NoImplicitPrelude #-}
+
 {-
     BNF Converter: C Skeleton generator
     Copyright (C) 2004  Author:  Michael Pellauer
@@ -14,7 +16,7 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 {-
@@ -39,10 +41,11 @@
 
 module BNFC.Backend.C.CFtoCSkel (cf2CSkel) where
 
+import Prelude'
+
 import BNFC.CF
 import BNFC.Utils                       ( (+++) )
 import BNFC.Backend.Common.NamedVariables
-import BNFC.Backend.Utils (isTokenType)
 import Data.Char                ( toLower, toUpper )
 import Data.Either (lefts)
 
@@ -106,7 +109,7 @@
 mkCFile cf groups = concat
    [
     header,
-    concatMap (prData user) groups,
+    concatMap prData groups,
     concatMap (prUser.show) user,
     footer
    ]
@@ -159,13 +162,13 @@
      ]
 
 --Visit functions for a category.
-prData :: [UserDef] -> (Cat, [Rule]) -> String
-prData user (cat, rules)
+prData :: (Cat, [Rule]) -> String
+prData (cat, rules)
   | isList cat = unlines
                [
                 "void visit" ++ cl ++ "("++ cl +++ vname ++ ")",
                 "{",
-                "  while(" ++ vname ++ " != 0)",
+                "  while(" ++ vname +++ " != 0)",
                 "  {",
                 "    /* Code For " ++ cl ++ " Goes Here */",
                 "    visit" ++ ecl ++ "(" ++ vname ++ "->" ++ member ++ "_);",
@@ -181,7 +184,7 @@
                 "{",
                 "  switch(_p_->kind)",
                 "  {",
-                concatMap (render . prPrintRule user) rules,
+                concatMap (render . prPrintRule) rules,
                 "  default:",
                 "    fprintf(stderr, \"Error: bad kind field when printing " ++ cl ++ "!\\n\");",
                 "    exit(1);",
@@ -195,39 +198,44 @@
 
 -- | Visits all the instance variables of a category.
 -- >>> let ab = Cat "ab"
--- >>> prPrintRule [] (Rule "abc" undefined [Left ab, Left ab])
+-- >>> prPrintRule (Rule "abc" undefined [Left ab, Left ab])
 --   case is_abc:
 --     /* Code for abc Goes Here */
 --     visitab(_p_->u.abc_.ab_1);
 --     visitab(_p_->u.abc_.ab_2);
 --     break;
--- >>> prPrintRule [ab] (Rule "abc" undefined [Left ab])
+-- <BLANKLINE>
+-- >>> let ab = TokenCat "ab"
+-- >>> prPrintRule (Rule "abc" undefined [Left ab])
 --   case is_abc:
 --     /* Code for abc Goes Here */
 --     visitAb(_p_->u.abc_.ab_);
 --     break;
--- >>> prPrintRule [ab] (Rule "abc" undefined [Left ab, Left ab])
+-- <BLANKLINE>
+-- >>> prPrintRule (Rule "abc" undefined [Left ab, Left ab])
 --   case is_abc:
 --     /* Code for abc Goes Here */
 --     visitAb(_p_->u.abc_.ab_1);
 --     visitAb(_p_->u.abc_.ab_2);
 --     break;
-prPrintRule :: [UserDef] -> Rule -> Doc
-prPrintRule user (Rule fun _c cats) | not (isCoercion fun) = nest 2 $ vcat
+-- <BLANKLINE>
+prPrintRule :: Rule -> Doc
+prPrintRule (Rule fun _c cats) | not (isCoercion fun) = nest 2 $ vcat
     [ text $ "case is_" ++ fun ++ ":"
     , nest 2 (vcat
         [ "/* Code for " <> text fun <> " Goes Here */"
         , cats'
-        , "break;" ])
+        , "break;\n"
+        ])
     ]
   where
-    cats' = vcat $ map (prCat user fun) (lefts (numVars cats))
-prPrintRule _user (Rule _fun _ _) = ""
+    cats' = vcat $ map (prCat fun) (lefts (numVars cats))
+prPrintRule (Rule _fun _ _) = ""
 
 -- Prints the actual instance-variable visiting.
-prCat :: [UserDef] -> Fun -> (Cat, Doc) -> Doc
-prCat user fnm (cat, vname) =
-      let visitf = "visit" <> if isTokenType user cat
+prCat :: Fun -> (Cat, Doc) -> Doc
+prCat fnm (cat, vname) =
+      let visitf = "visit" <> if isTokenCat cat
                        then basicFunName cat
                        else text (identCat (normCat cat))
       in visitf <> parens ("_p_->u." <> text v <> "_." <> vname ) <> ";"
diff --git a/src/BNFC/Backend/C/CFtoFlexC.hs b/src/BNFC/Backend/C/CFtoFlexC.hs
--- a/src/BNFC/Backend/C/CFtoFlexC.hs
+++ b/src/BNFC/Backend/C/CFtoFlexC.hs
@@ -1,3 +1,5 @@
+{-# LANGUAGE NoImplicitPrelude #-}
+
 {-
     BNF Converter: C flex generator
     Copyright (C) 2004  Author:  Michael Pellauer
@@ -14,7 +16,7 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 {-
@@ -35,11 +37,17 @@
 
    **************************************************************
 -}
-module BNFC.Backend.C.CFtoFlexC (cf2flex) where
+module BNFC.Backend.C.CFtoFlexC (cf2flex, lexComments, cMacros) where
 
+import Prelude'
+
+import Data.Maybe (fromMaybe)
+
 import BNFC.CF
 import BNFC.Backend.CPP.NoSTL.RegToFlex
 import BNFC.Backend.Common.NamedVariables
+import BNFC.PrettyPrint
+import BNFC.Utils (cstring)
 
 --The environment must be returned for the parser to use.
 cf2flex :: String -> CF -> (String, SymEnv)
@@ -51,7 +59,7 @@
   restOfFlex cf env'
  ], env')
   where
-   env = makeSymEnv (symbols cf ++ reservedWords cf) (0 :: Int)
+   env = makeSymEnv (cfgSymbols cf ++ reservedWords cf) (0 :: Int)
    env' = env ++ (makeSymEnv (tokenNames cf) (length env))
    makeSymEnv [] _ = []
    makeSymEnv (s:symbs) n = (s, "_SYMB_" ++ (show n)) : (makeSymEnv symbs (n+1))
@@ -85,8 +93,8 @@
    "%}"
   ]
 
---For now all categories are included.
---Optimally only the ones that are used should be generated.
+-- For now all categories are included.
+-- Optimally only the ones that are used should be generated.
 cMacros :: String
 cMacros = unlines
   [
@@ -110,7 +118,8 @@
 restOfFlex :: CF -> SymEnv -> String
 restOfFlex cf env = concat
   [
-   lexComments (comments cf),
+   render $ lexComments Nothing (comments cf),
+   "\n\n",
    userDefTokens,
    ifC catString  strStates,
    ifC catChar    chStates,
@@ -157,26 +166,92 @@
     ]
    footer = "void initialize_lexer(FILE *inp) { yyrestart(inp); BEGIN YYINITIAL; }"
 
-lexComments :: ([(String, String)], [String]) -> String
-lexComments (m,s) =
-  (unlines (map lexSingleComment s))
-  ++ (unlines (map lexMultiComment m))
+-- ---------------------------------------------------------------------------
+-- Comments
 
-lexSingleComment :: String -> String
-lexSingleComment c =
-  "<YYINITIAL>\"" ++ c ++ "\"[^\\n]*\\n     ++yy_mylinenumber; \t /* BNFC single-line comment */;"
+-- | Create flex rules for single-line and multi-lines comments.
+-- The first argument is an optional namespace (for C++); the second
+-- argument is the set of comment delimiters as returned by BNFC.CF.comments.
+--
+-- This function is only compiling the results of applying either
+-- lexSingleComment or lexMultiComment on each comment delimiter or pair of
+-- delimiters.
+--
+-- >>> lexComments (Just "myns.") ([("{-","-}")],["--"])
+-- <YYINITIAL>"--"[^\n]*\n ++myns.yy_mylinenumber; // BNFC: comment "--";
+-- <YYINITIAL>"{-" BEGIN COMMENT; // BNFC: comment "{-" "-}";
+-- <COMMENT>"-}" BEGIN YYINITIAL;
+-- <COMMENT>. /* skip */;
+-- <COMMENT>[\n] ++myns.yy_mylinenumber;
+lexComments :: Maybe String -> ([(String, String)], [String]) -> Doc
+lexComments ns (m,s) =
+    vcat (map (lexSingleComment ns) s ++ map (lexMultiComment ns) m)
 
---There might be a possible bug here if a language includes 2 multi-line comments.
---They could possibly start a comment with one character and end it with another.
---However this seems rare.
-lexMultiComment :: (String, String) -> String
-lexMultiComment (b,e) = unlines [
-  "<YYINITIAL>\"" ++ b ++ "\"      \t BEGIN COMMENT;",
-  "<COMMENT>\"" ++ e ++ "\"      \t BEGIN YYINITIAL;",
-  "<COMMENT>.      \t /* BNFC multi-line comment */;",
-  "<COMMENT>[\\n]    ++yy_mylinenumber ; \t /* BNFC multi-line comment */;"
-  ]
+-- | Create a lexer rule for single-line comments.
+-- The first argument is -- an optional c++ namespace
+-- The second argument is the delimiter that marks the beginning of the
+-- comment.
+--
+-- >>> lexSingleComment (Just "mypackage.") "--"
+-- <YYINITIAL>"--"[^\n]*\n ++mypackage.yy_mylinenumber; // BNFC: comment "--";
+--
+-- >>> lexSingleComment Nothing "--"
+-- <YYINITIAL>"--"[^\n]*\n ++yy_mylinenumber; // BNFC: comment "--";
+--
+-- >>> lexSingleComment Nothing "\""
+-- <YYINITIAL>"\""[^\n]*\n ++yy_mylinenumber; // BNFC: comment "\"";
+lexSingleComment :: Maybe String -> String -> Doc
+lexSingleComment ns c =
+    "<YYINITIAL>" <> cstring c <> "[^\\n]*\\n"
+    <+> "++"<> text (fromMaybe "" ns)<>"yy_mylinenumber;"
+    <+> "// BNFC: comment" <+> cstring c <> ";"
 
+-- | Create a lexer rule for multi-lines comments.
+-- The first argument is -- an optional c++ namespace
+-- The second arguments is the pair of delimiter for the multi-lines comment:
+-- start deleminiter and end delimiter.
+-- There might be a possible bug here if a language includes 2 multi-line
+-- comments. They could possibly start a comment with one character and end it
+-- with another.  However this seems rare.
+--
+-- >>> lexMultiComment Nothing ("{-", "-}")
+-- <YYINITIAL>"{-" BEGIN COMMENT; // BNFC: comment "{-" "-}";
+-- <COMMENT>"-}" BEGIN YYINITIAL;
+-- <COMMENT>. /* skip */;
+-- <COMMENT>[\n] ++yy_mylinenumber;
+--
+-- >>> lexMultiComment (Just "foo.") ("{-", "-}")
+-- <YYINITIAL>"{-" BEGIN COMMENT; // BNFC: comment "{-" "-}";
+-- <COMMENT>"-}" BEGIN YYINITIAL;
+-- <COMMENT>. /* skip */;
+-- <COMMENT>[\n] ++foo.yy_mylinenumber;
+--
+-- >>> lexMultiComment Nothing ("\"'", "'\"")
+-- <YYINITIAL>"\"'" BEGIN COMMENT; // BNFC: comment "\"'" "'\"";
+-- <COMMENT>"'\"" BEGIN YYINITIAL;
+-- <COMMENT>. /* skip */;
+-- <COMMENT>[\n] ++yy_mylinenumber;
+lexMultiComment :: Maybe String -> (String, String) -> Doc
+lexMultiComment ns (b,e) = vcat
+    [ "<YYINITIAL>" <> cstring b <+> "BEGIN COMMENT;"
+        <+> "// BNFC: comment" <+> cstring b <+> cstring e <> ";"
+    , "<COMMENT>" <> cstring e <+> "BEGIN YYINITIAL;"
+    , "<COMMENT>. /* skip */;"
+    , "<COMMENT>[\\n] ++"<> text (fromMaybe "" ns) <>"yy_mylinenumber;"
+    ]
+
+-- --There might be a possible bug here if a language includes 2 multi-line comments.
+-- --They could possibly start a comment with one character and end it with another.
+-- --However this seems rare.
+-- --
+-- lexMultiComment :: Maybe String -> (String, String) -> String
+-- lexMultiComment inPackage (b,e) = unlines [
+--   "<YYINITIAL>\"" ++ b ++ "\"      \t BEGIN COMMENT;",
+--   "<COMMENT>\"" ++ e ++ "\"      \t BEGIN YYINITIAL;",
+--   "<COMMENT>.      \t /* BNFC multi-line comment */;",
+--   "<COMMENT>[\\n]   ++" ++ nsString inPackage ++ "yy_mylinenumber ; \t /* BNFC multi-line comment */;"
+--  ---- "\\n  ++yy_mylinenumber ;"
+--   ]
 --Helper function that escapes characters in strings
 escapeChars :: String -> String
 escapeChars [] = []
diff --git a/src/BNFC/Backend/CPP/Makefile.hs b/src/BNFC/Backend/CPP/Makefile.hs
new file mode 100644
--- /dev/null
+++ b/src/BNFC/Backend/CPP/Makefile.hs
@@ -0,0 +1,52 @@
+module BNFC.Backend.CPP.Makefile (makefile) where
+
+import BNFC.Backend.Common.Makefile
+import BNFC.PrettyPrint
+
+makefile :: String -> Doc
+makefile name = vcat
+    [ mkVar "CC" "g++"
+    , mkVar "CCFLAGS" "-g -W -Wall"
+    , ""
+    , mkVar "FLEX" "flex"
+    , mkVar "FLEX_OPTS" ("-P" ++ name)
+    , ""
+    , mkVar "BISON" "bison"
+    , mkVar "BISON_OPTS" ("-t -p" ++ name)
+    , ""
+    , mkVar "OBJS" "Absyn.o Lexer.o Parser.o Printer.o"
+    , ""
+    , mkRule ".PHONY" ["clean", "distclean"]
+        []
+    , mkRule "all" [testName]
+        []
+    , mkRule "clean" []
+        -- peteg: don't nuke what we generated - move that to the "vclean" target.
+        [ "rm -f *.o " ++ testName ++ " " ++ unwords
+            [ name ++ e | e <- [".aux", ".log", ".pdf",".dvi", ".ps", ""]] ]
+    , mkRule "distclean" ["clean"]
+        [ "rm -f " ++ unwords
+            [ "Absyn.C", "Absyn.H", "Test.C", "Parser.C", "Parser.H", "Lexer.C",
+              "Skeleton.C", "Skeleton.H", "Printer.C", "Printer.H", "Makefile " ]
+            ++ name ++ ".l " ++ name ++ ".y " ++ name ++ ".tex "]
+    , mkRule testName [ "${OBJS}", "Test.o" ]
+        [ "@echo \"Linking " ++ testName ++ "...\""
+        , "${CC} ${CCFLAGS} ${OBJS} Test.o -o " ++ testName ]
+    , mkRule "Absyn.o" [ "Absyn.C", "Absyn.H" ]
+        [ "${CC} ${CCFLAGS} -c Absyn.C" ]
+    , mkRule "Lexer.C" [ name ++ ".l" ]
+        [ "${FLEX} -oLexer.C " ++ name ++ ".l" ]
+    , mkRule "Parser.C" [ name ++ ".y" ]
+      [ "${BISON} " ++ name ++ ".y -o Parser.C" ]
+    , mkRule "Lexer.o" [ "Lexer.C", "Parser.H" ]
+        [ "${CC} ${CCFLAGS} -c Lexer.C " ]
+    , mkRule "Parser.o" [ "Parser.C", "Absyn.H" ]
+        [ "${CC} ${CCFLAGS} -c Parser.C" ]
+    , mkRule "Printer.o" [ "Printer.C", "Printer.H", "Absyn.H" ]
+        [ "${CC} ${CCFLAGS} -c Printer.C" ]
+    , mkRule "Skeleton.o" [ "Skeleton.C", "Skeleton.H", "Absyn.H" ]
+       [ "${CC} ${CCFLAGS} -Wno-unused-parameter -c Skeleton.C" ]
+    , mkRule "Test.o" [ "Test.C", "Parser.H", "Printer.H", "Absyn.H" ]
+        [ "${CC} ${CCFLAGS} -c Test.C" ]
+    ]
+  where testName = "Test" ++ name
diff --git a/src/BNFC/Backend/CPP/Naming.hs b/src/BNFC/Backend/CPP/Naming.hs
new file mode 100644
--- /dev/null
+++ b/src/BNFC/Backend/CPP/Naming.hs
@@ -0,0 +1,21 @@
+module BNFC.Backend.CPP.Naming where
+
+import BNFC.Utils
+
+cReservedWords, cppReservedWords :: [String]
+cReservedWords = [ "auto", "const", "double", "float", "int", "short", "struct"
+    , "unsigned", "break", "continue", "else", "for", "long", "signed"
+    , "switch", "void", "case", "default", "enum", "goto", "register", "sizeof"
+    , "typedef", "volatile", "char", "do", "extern", "if", "return", "static"
+    , "union", "while" ]
+
+cppReservedWords = cReservedWords ++ [ "asm", "dynamic_cast", "namespace"
+    , "reinterpret_cast" , "try", "bool", "explicit", "new", "static_cast"
+    , "typeid", "catch" , "false", "operator", "template", "typename", "class"
+    , "friend" , "private", "this", "using", "const_cast", "inline", "public"
+    , "throw" , "virtual", "delete", "mutable", "protected", "true", "wchar_t"
+    , "and", "bitand", "compl", "not_eq", "or_eq", "xor_eq", "and_eq", "bitor"
+    , "not", "or", "xor" ]
+
+mkVariable :: String -> String
+mkVariable = mkName cppReservedWords SnakeCase
diff --git a/src/BNFC/Backend/CPP/NoSTL.hs b/src/BNFC/Backend/CPP/NoSTL.hs
--- a/src/BNFC/Backend/CPP/NoSTL.hs
+++ b/src/BNFC/Backend/CPP/NoSTL.hs
@@ -14,7 +14,7 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 module BNFC.Backend.CPP.NoSTL (makeCppNoStl) where
@@ -23,6 +23,7 @@
 import BNFC.CF
 import BNFC.Options
 import BNFC.Backend.Base
+import BNFC.Backend.CPP.Makefile
 import BNFC.Backend.CPP.NoSTL.CFtoCPPAbs
 import BNFC.Backend.CPP.NoSTL.CFtoFlex
 import BNFC.Backend.CPP.NoSTL.CFtoBison
@@ -52,47 +53,6 @@
     Makefile.mkMakefile opts $ makefile name
   where name = lang opts
 
-makefile :: String -> String
-makefile name =
-  (unlines [ "CC = g++",
-             "CCFLAGS = -g -W -Wall", "",
-             "FLEX = flex",
-             "FLEX_OPTS = -P" ++ name, "",
-             "BISON = bison",
-             "BISON_OPTS = -t -p" ++ name, "",
-             "OBJS = Absyn.o Lexer.o Parser.o Printer.o", "" ] ++)
-  $ Makefile.mkRule ".PHONY" ["clean", "distclean"]
-    []
-  $ Makefile.mkRule "all" [testName]
-    []
-  $ Makefile.mkRule "clean" []
-    -- peteg: don't nuke what we generated - move that to the "vclean" target.
-    [ "rm -f *.o " ++ testName ++ " " ++ unwords
-      [ name ++ e | e <- [".aux", ".log", ".pdf",".dvi", ".ps", ""]] ]
-  $ Makefile.mkRule "distclean" ["clean"]
-    [ "rm -f " ++ unwords
-      [ "Absyn.C", "Absyn.H", "Test.C", "Parser.C", "Parser.H", "Lexer.C",
-        "Skeleton.C", "Skeleton.H", "Printer.C", "Printer.H", "Makefile " ]
-      ++ name ++ ".l " ++ name ++ ".y " ++ name ++ ".tex "]
-  $ Makefile.mkRule (testName) [ "${OBJS}", "Test.o" ]
-    [ "@echo \"Linking " ++ testName ++ "...\""
-    , "${CC} ${CCFLAGS} ${OBJS} Test.o -o " ++ testName ]
-  $ Makefile.mkRule "Absyn.o" [ "Absyn.C", "Absyn.H" ]
-    [ "${CC} ${CCFLAGS} -c Absyn.C" ]
-  $ Makefile.mkRule "Lexer.C" [ name ++ ".l" ]
-    [ "${FLEX} -oLexer.C " ++ name ++ ".l" ]
-  $ Makefile.mkRule "Parser.C" [ name ++ ".y" ]
-    [ "${BISON} " ++ name ++ ".y -o Parser.C" ]
-  $ Makefile.mkRule "Lexer.o" [ "Lexer.C", "Parser.H" ]
-    [ "${CC} ${CCFLAGS} -c Lexer.C " ]
-  $ Makefile.mkRule "Parser.o" [ "Parser.C", "Absyn.H" ]
-    [ "${CC} ${CCFLAGS} -c Parser.C" ]
-  $ Makefile.mkRule "Printer.o" [ "Printer.C", "Printer.H", "Absyn.H" ]
-    [ "${CC} ${CCFLAGS} -c Printer.C" ]
-  $ Makefile.mkRule "Test.o" [ "Test.C", "Parser.H", "Printer.H", "Absyn.H" ]
-    [ "${CC} ${CCFLAGS} -c Test.C" ]
-  ""
-  where testName = "Test" ++ name
 
 cpptest :: CF -> String
 cpptest cf =
@@ -105,34 +65,60 @@
     "/*                                                                          */",
     "/****************************************************************************/",
     "#include <stdio.h>",
+    "#include <string.h>",
     "#include \"Parser.H\"",
     "#include \"Printer.H\"",
     "#include \"Absyn.H\"",
     "",
+    "void usage() {",
+    "  printf(\"usage: Call with one of the following argument " ++
+      "combinations:\\n\");",
+    "  printf(\"\\t--help\\t\\tDisplay this help message.\\n\");",
+    "  printf(\"\\t(no arguments)\tParse stdin verbosely.\\n\");",
+    "  printf(\"\\t(files)\\t\\tParse content of files verbosely.\\n\");",
+    "  printf(\"\\t-s (files)\\tSilent mode. Parse content of files " ++
+      "silently.\\n\");",
+    "}",
+    "",
     "int main(int argc, char ** argv)",
     "{",
     "  FILE *input;",
-    "  if (argc > 1) ",
-    "  {",
-    "    input = fopen(argv[1], \"r\");",
-    "    if (!input)",
-    "    {",
-    "      fprintf(stderr, \"Error opening input file.\\n\");",
-    "      exit(1);",
+    "  int quiet = 0;",
+    "  char *filename = NULL;",
+    "",
+    "  if (argc > 1) {",
+    "    if (strcmp(argv[1], \"-s\") == 0) {",
+    "      quiet = 1;",
+    "      if (argc > 2) {",
+    "        filename = argv[2];",
+    "      } else {",
+    "        input = stdin;",
+    "      }",
+    "    } else {",
+    "      filename = argv[1];",
     "    }",
     "  }",
-    "  else input = stdin;",
+    "",
+    "  if (filename) {",
+    "    input = fopen(filename, \"r\");",
+    "    if (!input) {",
+    "      usage();",
+    "      exit(1);",
+    "    }",
+    "  } else input = stdin;",
     "  /* The default entry point is used. For other options see Parser.H */",
     "  " ++ def ++ " *parse_tree = p" ++ def ++ "(input);",
     "  if (parse_tree)",
     "  {",
     "    printf(\"\\nParse Succesful!\\n\");",
-    "    printf(\"\\n[Abstract Syntax]\\n\");",
-    "    ShowAbsyn *s = new ShowAbsyn();",
-    "    printf(\"%s\\n\\n\", s->show(parse_tree));",
-    "    printf(\"[Linearized Tree]\\n\");",
-    "    PrintAbsyn *p = new PrintAbsyn();",
-    "    printf(\"%s\\n\\n\", p->print(parse_tree));",
+    "    if (!quiet) {",
+    "      printf(\"\\n[Abstract Syntax]\\n\");",
+    "      ShowAbsyn *s = new ShowAbsyn();",
+    "      printf(\"%s\\n\\n\", s->show(parse_tree));",
+    "      printf(\"[Linearized Tree]\\n\");",
+    "      PrintAbsyn *p = new PrintAbsyn();",
+    "      printf(\"%s\\n\\n\", p->print(parse_tree));",
+    "    }",
     "    return 0;",
     "  }",
     "  return 1;",
@@ -154,7 +140,7 @@
   "  char char_;",
   "  double double_;",
   "  char* string_;",
-  (concatMap mkVar cats) ++ "} YYSTYPE;",
+  concatMap mkVar cats ++ "} YYSTYPE;",
   "",
   "#define _ERROR_ 258",
   mkDefines (259 :: Int) env,
@@ -164,12 +150,12 @@
   "#endif"
  ]
  where
-  mkForwardDec s | (normCat s == s) = "class " ++ (identCat s) ++ ";\n"
+  mkForwardDec s | normCat s == s = "class " ++ identCat s ++ ";\n"
   mkForwardDec _ = ""
-  mkVar s | (normCat s == s) = "  " ++ (identCat s) ++"*" +++ (map toLower (identCat s)) ++ "_;\n"
+  mkVar s | normCat s == s = "  " ++ identCat s ++"*" +++ map toLower (identCat s) ++ "_;\n"
   mkVar _ = ""
   mkDefines n [] = mkString n
-  mkDefines n ((_,s):ss) = ("#define " ++ s +++ (show n) ++ "\n") ++ (mkDefines (n+1) ss)
+  mkDefines n ((_,s):ss) = "#define " ++ s +++ show n ++ "\n" ++ mkDefines (n+1) ss
   mkString n =  if isUsedCat cf catString
    then ("#define _STRING_ " ++ show n ++ "\n") ++ mkChar (n+1)
    else mkChar n
@@ -183,7 +169,7 @@
    then ("#define _DOUBLE_ " ++ show n ++ "\n") ++ mkIdent(n+1)
    else mkIdent n
   mkIdent n =  if isUsedCat cf catIdent
-   then ("#define _IDENT_ " ++ show n ++ "\n")
+   then "#define _IDENT_ " ++ show n ++ "\n"
    else ""
-  mkFunc s | (normCat s == s) = (identCat s) ++ "*" +++ "p" ++ (identCat s) ++ "(FILE *inp);\n"
+  mkFunc s | normCat s == s = identCat s ++ "*" +++ "p" ++ identCat s ++ "(FILE *inp);\n"
   mkFunc _ = ""
diff --git a/src/BNFC/Backend/CPP/NoSTL/CFtoBison.hs b/src/BNFC/Backend/CPP/NoSTL/CFtoBison.hs
--- a/src/BNFC/Backend/CPP/NoSTL/CFtoBison.hs
+++ b/src/BNFC/Backend/CPP/NoSTL/CFtoBison.hs
@@ -14,7 +14,7 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 {-
@@ -33,7 +33,7 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 {-
@@ -98,81 +98,78 @@
 
 header :: String -> CF -> String
 header name cf = unlines
-         ["/* This Bison file was machine-generated by BNFC */",
-	  "%{",
-	  "#include <stdlib.h>",
-	  "#include <stdio.h>",
-	  "#include <string.h>",
-	  "#include <iostream>",
-	  "#include \"Absyn.H\"",
-	  "int yyparse(void);",
-	  "int yylex(void);",
-	  "int yy_mylinenumber;",  --- hack to get line number. AR 2006
-	  "int initialize_lexer(FILE * inp);",
-          "int yywrap(void)",
-          "{",
-          "  return 1;",
-	  "}",
-          "void yyerror(const char *str)",
-          "{",
-          "  extern char *yytext;",
-          "  fprintf(stderr,\"error: line %d: %s at %s\\n\", ",
-          "    yy_mylinenumber + 1, str, yytext);",
-          "}",
-	  "",
-	  definedRules cf,
-	  unlines $ map (parseMethod name) (allCatsNorm cf),  -- (allEntryPoints cf), M.F. 2004-09-14 fix of [Ty2] bug.
-	  concatMap reverseList (filter isList (allCatsNorm cf)),
-	  "%}"
-	  ]
+    [ "/* This Bison file was machine-generated by BNFC */"
+    , "%{"
+    , "#include <stdlib.h>"
+    , "#include <stdio.h>"
+    , "#include <string.h>"
+    , "#include \"Absyn.H\""
+    , "int yyparse(void);"
+    , "int yylex(void);"
+    , "int yy_mylinenumber;"  --- hack to get line number. AR 2006
+    , "int initialize_lexer(FILE * inp);"
+    , "int yywrap(void)"
+    , "{"
+    , "  return 1;"
+    , "}"
+    , "void yyerror(const char *str)"
+    , "{"
+    , "  extern char *yytext;"
+    , "  fprintf(stderr,\"error: line %d: %s at %s\\n\", "
+    , "    yy_mylinenumber + 1, str, yytext);"
+    , "}"
+    , ""
+    , definedRules cf
+    , unlines $ map (parseMethod name) (allCatsNorm cf)  -- (allEntryPoints cf), M.F. 2004-09-14 fix of [Ty2] bug.
+    , concatMap reverseList (filter isList (allCatsNorm cf))
+    , "%}"
+    ]
 
 definedRules :: CF -> String
-definedRules cf =
-	unlines [ rule f xs e | FunDef f xs e <- pragmasOfCF cf]
-    where
-	ctx = buildContext cf
-
-	list = LC (const "[]") (\t -> "List" ++ unBase t)
-	    where
-		unBase (ListT t) = unBase t
-		unBase (BaseT x) = show$normCat$strToCat x
+definedRules cf = unlines [ rule f xs e | FunDef f xs e <- cfgPragmas cf]
+  where
+    ctx = buildContext cf
 
-	rule f xs e =
-	    case checkDefinition' list ctx f xs e of
-		Bad err	-> error $ "Panic! This should have been caught already:\n" ++ err
-		Ok (args,(e',t)) -> unlines
-		    [ cppType t ++ " " ++ f ++ "_ (" ++
-			concat (intersperse ", " $ map cppArg args) ++ ") {"
-		    , "  return " ++ cppExp e' ++ ";"
-		    , "}"
-		    ]
-	    where
+    list = LC (const "[]") (\ t -> "List" ++ unBase t)
+      where
+        unBase (ListT t) = unBase t
+        unBase (BaseT x) = show$normCat$strToCat x
 
-		cppType :: Base -> String
-		cppType (ListT (BaseT x)) = "List" ++ show (normCat (strToCat x)) ++ " *"
-		cppType (ListT t)	   = cppType t ++ " *"
-		cppType (BaseT x)
-		    | isToken x ctx = "String"
-		    | otherwise	    = show (normCat (strToCat x)) ++ " *"
+    rule f xs e =
+        case checkDefinition' list ctx f xs e of
+            Bad err -> error $ "Panic! This should have been caught already:\n" ++ err
+            Ok (args,(e',t)) -> unlines
+                [ cppType t ++ " " ++ f ++ "_ (" ++
+                  concat (intersperse ", " $ map cppArg args) ++ ") {"
+                , "  return " ++ cppExp e' ++ ";"
+                , "}"
+                ]
+      where
+        cppType :: Base -> String
+        cppType (ListT (BaseT x)) = "List" ++ show (normCat (strToCat x)) ++ " *"
+        cppType (ListT t) = cppType t ++ " *"
+        cppType (BaseT x)
+            | isToken x ctx = "String"
+            | otherwise = show (normCat (strToCat x)) ++ " *"
 
-		cppArg :: (String, Base) -> String
-		cppArg (x,t) = cppType t ++ " " ++ x ++ "_"
+        cppArg :: (String, Base) -> String
+        cppArg (x,t) = cppType t ++ " " ++ x ++ "_"
 
-		cppExp :: Exp -> String
-		cppExp (App "[]" []) = "0"
-		cppExp (App x [])
-		    | elem x xs		= x ++ "_"	-- argument
-		cppExp (App t [e])
-		    | isToken t ctx	= cppExp e
-		cppExp (App x es)
-		    | isUpper (head x)	= call ("new " ++ x) es
-		    | otherwise		= call (x ++ "_") es
-		cppExp (LitInt n)	= show n
-		cppExp (LitDouble x)	= show x
-		cppExp (LitChar c)	= show c
-		cppExp (LitString s)	= show s
+        cppExp :: Exp -> String
+        cppExp (App "[]" []) = "0"
+        cppExp (App x [])
+            | elem x xs = x ++ "_"  -- argument
+        cppExp (App t [e])
+            | isToken t ctx = cppExp e
+        cppExp (App x es)
+            | isUpper (head x) = call ("new " ++ x) es
+            | otherwise = call (x ++ "_") es
+        cppExp (LitInt n) = show n
+        cppExp (LitDouble x) = show x
+        cppExp (LitChar c) = show c
+        cppExp (LitString s) = show s
 
-		call x es = x ++ "(" ++ concat (intersperse ", " $ map cppExp es) ++ ")"
+        call x es = x ++ "(" ++ concat (intersperse ", " $ map cppExp es) ++ ")"
 
 
 --This generates a parser method for each entry point.
@@ -267,7 +264,7 @@
      "(:)" -> identCat (normCat nt)
      "(:[])" -> identCat (normCat nt)
      z -> z
-   revs = reversibleCats cf
+   revs = cfgReversibleCats cf
    eps = allEntryPoints cf
    isEntry nt = if elem nt eps then True else False
    result = if isEntry nt then (resultName (identCat (normCat nt))) ++ "= $$;" else ""
@@ -303,7 +300,7 @@
    revIf c m = if (not (isConsFun (funRule r)) && elem c revs)
                  then ("reverse" ++ (identCat (normCat c)) ++ "(" ++ m ++ ")")
                else m  -- no reversal in the left-recursive Cons rule itself
-   revs = reversibleCats cf
+   revs = cfgReversibleCats cf
 
 -- We have now constructed the patterns and actions,
 -- so the only thing left is to merge them into one string.
diff --git a/src/BNFC/Backend/CPP/NoSTL/CFtoCPPAbs.hs b/src/BNFC/Backend/CPP/NoSTL/CFtoCPPAbs.hs
--- a/src/BNFC/Backend/CPP/NoSTL/CFtoCPPAbs.hs
+++ b/src/BNFC/Backend/CPP/NoSTL/CFtoCPPAbs.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE NoImplicitPrelude, OverloadedStrings #-}
 {-
     BNF Converter: C++ abstract syntax generator
     Copyright (C) 2004  Author:  Michael Pellauer
@@ -15,7 +15,7 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 {-
@@ -41,6 +41,8 @@
 
 module BNFC.Backend.CPP.NoSTL.CFtoCPPAbs (cf2CPPAbs) where
 
+import Prelude'
+
 import BNFC.CF
 import BNFC.Utils((+++),(++++))
 import BNFC.Backend.Common.NamedVariables
@@ -87,18 +89,17 @@
 --Prints interface classes for all categories.
 prDataH :: [UserDef] -> Data -> String
 prDataH  user (cat, rules) =
-  case lookup (show cat) rules of
-    Just _ -> concatMap (prRuleH user cat) rules
-    Nothing -> if isList cat
-      then concatMap (prRuleH user cat) rules
-      else unlines
-       [
-        "class" +++ (identCat cat) +++ ": public Visitable {",
-	"public:",
-	"  virtual" +++ (identCat cat) +++ "*clone() const = 0;",
-	"};\n",
-        concatMap (prRuleH user cat) rules
-       ]
+    case lookup (show cat) rules of
+        Just _ -> concatMap (prRuleH user cat) rules
+        Nothing -> if isList cat
+            then concatMap (prRuleH user cat) rules
+            else unlines
+                [ "class" +++ identCat cat +++ ": public Visitable {"
+                , "public:"
+                , "  virtual" +++ identCat cat +++ "*clone() const = 0;"
+                , "};\n"
+                , concatMap (prRuleH user cat) rules
+                ]
 
 --Interface definitions for rules vary on the type of rule.
 prRuleH :: [UserDef] -> Cat -> (Fun, [Cat]) -> String
@@ -134,7 +135,7 @@
      render $ nest 2 $ prInstVars user vs,
      "  " ++ fun ++ "(const" +++ fun +++ "&);",
      "  " ++ fun ++ " &operator=(const" +++ fun +++ "&);",
-     "  " ++ fun ++ "(" ++ (prConstructorH 1 vs) ++ ");",
+     "  " ++ fun ++ "(" ++ prConstructorH 1 vs ++ ");",
      prDestructorH fun,
      "  virtual void accept(Visitor *v);",
      "  virtual " +++ fun +++ " *clone() const;",
@@ -146,11 +147,11 @@
      c' = identCat (normCat c);
      mem = drop 4 c'
      memstar = if isBasic user mem then "" else "*"
-     super = if show c == fun then "Visitable" else (identCat c)
+     super = if show c == fun then "Visitable" else identCat c
      prConstructorH :: Int -> [(String, b)] -> String
      prConstructorH _ [] = ""
-     prConstructorH n ((t,_):[]) = t +++ (optstar t) ++ "p" ++ (show n)
-     prConstructorH n ((t,_):vs) =( t +++ (optstar t) ++ "p" ++ (show n) ++ ", ") ++ (prConstructorH (n+1) vs)
+     prConstructorH n [(t,_)] = t +++ optstar t ++ "p" ++ show n
+     prConstructorH n ((t,_):vs) = t +++ optstar t ++ "p" ++ show n ++ ", " ++ prConstructorH (n+1) vs
      prDestructorH n = "  ~" ++ n ++ "();"
      optstar x = if isBasic user x
        then ""
@@ -177,7 +178,7 @@
   "{",
   " public:",
   "  virtual ~Visitor() {}",
-  (concatMap (prVisitFun) fs),
+  concatMap prVisitFun fs,
   footer
  ]
  where
@@ -228,8 +229,8 @@
     remType :: String -> [IVar] -> [IVar]
     remType _ [] = []
     remType t ((t2,n):ts) = if t == t2
-   				then (remType t ts)
-				else (t2,n) : (remType t ts)
+        then remType t ts
+        else (t2,n) : remType t ts
 
 
 {- **** Implementation (.C) File Functions **** -}
@@ -323,7 +324,7 @@
   "}"
  ]
  where
-   v = (map toLower c) ++ "_"
+   v = map toLower c ++ "_"
    m = drop 4 c
    mstar = if isBasic user m then "" else "*"
    m' = drop 4 v
@@ -339,7 +340,7 @@
 -- bla::bla(A *p1, Integer p2, A *p3) { a_1 = p1; integer_ = p2; a_2 = p3; }
 prConstructorC :: [UserDef] -> String -> [IVar] -> [Cat] -> Doc
 prConstructorC user c vs cats =
-    text c <> "::" <> text c <> parens (args)
+    text c <> "::" <> text c <> parens args
     <+> "{" <+> text (prAssigns vs params) <> "}"
   where
     (types, params) = unzip (prParams cats (length cats) (length cats+1))
@@ -363,14 +364,14 @@
       concatMap swapV vs ++++
       "}\n"
     where  doV :: IVar -> String
-	   doV v@(t, _)
-	     | isBasic user t = "  " ++ vn v ++ " = other." ++ vn v ++ ";\n"
-	     | otherwise = "  " ++ vn v ++ " = other." ++ vn v ++ "->clone();\n"
-	   vn :: IVar -> String
-	   vn (t, 0) = varName t
-	   vn (t, n) = varName t ++ show n
-	   swapV :: IVar -> String
-	   swapV v = "  std::swap(" ++ vn v ++ ", other." ++ vn v ++ ");\n"
+           doV v@(t, _)
+             | isBasic user t = "  " ++ vn v ++ " = other." ++ vn v ++ ";\n"
+             | otherwise = "  " ++ vn v ++ " = other." ++ vn v ++ "->clone();\n"
+           vn :: IVar -> String
+           vn (t, 0) = varName t
+           vn (t, n) = varName t ++ show n
+           swapV :: IVar -> String
+           swapV v = "  std::swap(" ++ vn v ++ ", other." ++ vn v ++ ");\n"
 
 --The cloner makes a new deep copy of the object
 prCloneC :: [UserDef] -> String -> [IVar] -> String
@@ -381,21 +382,20 @@
 --The destructor deletes all a class's members.
 prDestructorC :: [UserDef] -> String -> [IVar] -> String
 prDestructorC user c vs  =
-  c ++ "::~" ++ c ++"()" +++ "{" +++
-   (concatMap prDeletes vs) ++ "}"
+    c ++ "::~" ++ c ++"()" +++ "{" +++
+    concatMap prDeletes vs ++ "}"
   where
-   prDeletes :: (String, Int) -> String
-   prDeletes (t, n) = if isBasic user t
-    then ""
-    else if n == 0
-     then "delete(" ++ (varName t) ++ "); "
-     else "delete(" ++ (varName t) ++ (show n) ++ "); "
+    prDeletes :: (String, Int) -> String
+    prDeletes (t, n)
+        | isBasic user t = ""
+        | n == 0 = "delete(" ++ varName t ++ "); "
+        | otherwise = "delete(" ++ varName t ++ show n ++ "); "
 
 --Prints the constructor's parameters.
 prParams :: [Cat] -> Int -> Int -> [(String,String)]
 prParams [] _ _ = []
-prParams (c:cs) n m = (identCat c,"p" ++ (show (m-n)))
-			: (prParams cs (n-1) m)
+prParams (c:cs) n m = (identCat c, "p" ++ show (m-n))
+                    : prParams cs (n-1) m
 
 --Prints the assignments of parameters to instance variables.
 --This algorithm peeks ahead in the list so we don't use map or fold
@@ -415,12 +415,4 @@
 --Checks if something is a basic or user-defined type.
 isBasic :: [UserDef] -> String -> Bool
 isBasic user x =
-  if elem x (map show user)
-    then True
-    else case x of
-      "Integer" -> True
-      "Char" -> True
-      "String" -> True
-      "Double" -> True
-      "Ident" -> True
-      _ -> False
+    x `elem` (map show user ++ ["Integer", "Char", "String", "Double", "Ident"])
diff --git a/src/BNFC/Backend/CPP/NoSTL/CFtoCVisitSkel.hs b/src/BNFC/Backend/CPP/NoSTL/CFtoCVisitSkel.hs
--- a/src/BNFC/Backend/CPP/NoSTL/CFtoCVisitSkel.hs
+++ b/src/BNFC/Backend/CPP/NoSTL/CFtoCVisitSkel.hs
@@ -1,3 +1,5 @@
+{-# LANGUAGE NoImplicitPrelude #-}
+
 {-
     BNF Converter: C++ Skeleton generation
     Copyright (C) 2004  Author:  Michael Pellauer
@@ -14,7 +16,7 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 {-
@@ -39,10 +41,12 @@
 
 module BNFC.Backend.CPP.NoSTL.CFtoCVisitSkel (cf2CVisitSkel) where
 
+import Prelude'
+
 import BNFC.CF
 import BNFC.Utils ((+++))
 import BNFC.Backend.Common.NamedVariables
-import BNFC.Backend.Utils (isTokenType)
+import BNFC.Backend.CPP.Naming (mkVariable)
 import Data.List
 import Data.Char(toLower, toUpper)
 import Data.Either (lefts)
@@ -98,22 +102,22 @@
 --Prints out visit functions for a category
 prDataH :: (Cat, [Rule]) -> String
 prDataH (cat, rules) =
- if "List" `isPrefixOf` identCat cat
- then concat ["  void visit", cl, "(", cl, "* ", vname, ");"]
+ if isList cat
+ then concat ["  void visit", cl, "(", cl, " *", vname, ");"]
  else abstract ++ concatMap prRuleH rules
  where
    cl = identCat (normCat cat)
-   vname = map toLower cl
+   vname = mkVariable cl
    abstract = case lookupRule (show cat) rules of
     Just _ -> ""
-    Nothing ->  "  void visit" ++ cl ++ "(" ++ cl ++ "*" +++ vname ++ "); /* abstract class */\n"
+    Nothing ->  "  void visit" ++ cl ++ "(" ++ cl +++ "*" ++ vname ++ "); /* abstract class */\n"
 
 --Visit functions for a rule.
 prRuleH :: Rule -> String
 prRuleH (Rule fun _ _) | not (isCoercion fun) = concat
-  ["  void visit", fun, "(", fun, "* ", fnm, ");\n"]
+  ["  void visit", fun, "(", fun, " *", fnm, ");\n"]
    where
-    fnm = map toLower fun
+    fnm = mkVariable fun
 prRuleH _ = ""
 
 
@@ -145,7 +149,8 @@
       "void Skeleton::visit" ++ x' ++ "(" ++ x ++ " p)",
       "{",
       "  /* Code for " ++ x ++ " Goes Here */",
-      "}"
+      "}",
+      ""
      ]
      where
        x' = ((toUpper (head x)) : (map toLower (tail x))) --this is a hack to fix a potential capitalization problem.
@@ -155,18 +160,22 @@
       "{",
       "  /* Code for Ident Goes Here */",
       "}",
+      "",
       "void Skeleton::visitInteger(Integer i)",
       "{",
       "  /* Code for Integers Goes Here */",
       "}",
+      "",
       "void Skeleton::visitDouble(Double d)",
       "{",
       "  /* Code for Doubles Goes Here */",
       "}",
+      "",
       "void Skeleton::visitChar(Char c)",
       "{",
       "  /* Code for Chars Goes Here */",
       "}",
+      "",
       "void Skeleton::visitString(String s)",
       "{",
       "  /* Code for Strings Goes Here */",
@@ -177,24 +186,25 @@
 --Visit functions for a category.
 prData :: [UserDef] -> (Cat, [Rule]) -> String
 prData user (cat, rules) =
- if "List" `isPrefixOf` (identCat cat)
+ if isList cat
  then unlines
  [
-  "void Skeleton::visit" ++ cl ++ "("++ cl ++ "*" +++ vname ++ ")",
+  "void Skeleton::visit" ++ cl ++ "("++ cl +++ "*" ++ vname ++ ")",
   "{",
-  "  while(" ++ vname ++ "!= 0)",
+  "  while(" ++ vname +++ "!= 0)",
   "  {",
   "    /* Code For " ++ cl ++ " Goes Here */",
   visitMember,
-  "    " ++ vname ++ " = " ++ vname ++ "->" ++ vname ++ "_;",
+  "    " ++ vname ++ " = " ++ vname ++ "->" ++ vname' ++ "_;",
   "  }",
   "}",
   ""
  ] --Not a list:
- else abstract ++ (concatMap (render . prRule user) rules)
+ else abstract ++ (concatMap (render . prRule) rules)
  where
    cl = identCat (normCat cat)
-   vname = map toLower cl
+   vname = mkVariable cl
+   vname' = map toLower cl
    ecl = identCat (normCatOfList cat)
    member = map toLower ecl ++ "_"
    visitMember = if isBasic user member
@@ -202,41 +212,43 @@
      else "    " ++ vname ++ "->" ++ member ++ "->accept(this);"
    abstract = case lookupRule (show cat) rules of
     Just _ -> ""
-    Nothing ->  "void Skeleton::visit" ++ cl ++ "(" ++ cl ++ "*" +++ vname ++ ") {} //abstract class\n\n"
+    Nothing ->  "void Skeleton::visit" ++ cl ++ "(" ++ cl +++ "*" ++ vname ++ ") {} //abstract class\n\n"
 
 -- | Visits all the instance variables of a category.
--- >>> prRule [Cat "A"] (Rule "F" (Cat "S") [Right "X", Left (Cat "A"), Left (Cat "B")])
--- void Skeleton::visitF(F* f)
+-- >>> prRule (Rule "F" (Cat "S") [Right "X", Left (TokenCat "A"), Left (Cat "B")])
+-- void Skeleton::visitF(F *f)
 -- {
 --   /* Code For F Goes Here */
 -- <BLANKLINE>
 --   visitA(f->a_);
 --   f->b_->accept(this);
 -- }
-prRule :: [UserDef] -> Rule -> Doc
-prRule user (Rule fun _ cats) | not (isCoercion fun) = vcat
-  [ text ("void Skeleton::visit" ++ fun ++ "(" ++ fun ++ "*" +++ fnm ++ ")")
+-- <BLANKLINE>
+prRule :: Rule -> Doc
+prRule (Rule fun _ cats) | not (isCoercion fun) = vcat
+  [ text ("void Skeleton::visit" ++ fun ++ "(" ++ fun +++ "*" ++ fnm ++ ")")
   , codeblock 2
       [ text ("/* Code For " ++ fun ++ " Goes Here */")
       , ""
       , cats'
       ]
+  , ""
   ]
    where
-    cats' = vcat (map (prCat user fnm) (lefts (numVars cats)))
-    fnm = map toLower fun
-prRule _ _ = ""
+    cats' = vcat (map (prCat fnm) (lefts (numVars cats)))
+    fnm = mkVariable fun
+prRule _ = ""
 
 -- | Prints the actual instance-variable visiting.
--- >>> prCat [] "Myfun" (Cat "Integer", "integer_")
+-- >>> prCat "Myfun" (TokenCat "Integer", "integer_")
 -- visitInteger(Myfun->integer_);
--- >>> prCat [] "Myfun" (ListCat (Cat "A"), "lista_")
+-- >>> prCat "Myfun" (ListCat (Cat "A"), "lista_")
 -- if (Myfun->lista_) {Myfun->lista_->accept(this);}
--- >>> prCat [] "Myfun" (Cat "A", "a_")
+-- >>> prCat "Myfun" (Cat "A", "a_")
 -- Myfun->a_->accept(this);
-prCat :: [Cat] -> String -> (Cat, Doc) -> Doc
-prCat user fnm (cat, nt)
-  | isTokenType user cat = "visit" <> text (funName (render nt)) <> parens (fname <> "->" <> nt) <> ";"
+prCat :: String -> (Cat, Doc) -> Doc
+prCat fnm (cat, nt)
+  | isTokenCat cat = "visit" <> text (funName (render nt)) <> parens (fname <> "->" <> nt) <> ";"
   | isList cat = "if" <+> parens (fname <> "->" <> nt) <+> braces accept
   | otherwise = accept
   where accept = fname <> "->" <> nt <> "->accept(this);"
diff --git a/src/BNFC/Backend/CPP/NoSTL/CFtoFlex.hs b/src/BNFC/Backend/CPP/NoSTL/CFtoFlex.hs
--- a/src/BNFC/Backend/CPP/NoSTL/CFtoFlex.hs
+++ b/src/BNFC/Backend/CPP/NoSTL/CFtoFlex.hs
@@ -14,7 +14,7 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 {-
@@ -38,9 +38,11 @@
 module BNFC.Backend.CPP.NoSTL.CFtoFlex (cf2flex) where
 
 import BNFC.CF
+import BNFC.Backend.C.CFtoFlexC (lexComments, cMacros)
 import BNFC.Backend.CPP.NoSTL.RegToFlex
 import BNFC.Backend.Common.NamedVariables
 import BNFC.Backend.CPP.STL.STLUtils
+import BNFC.PrettyPrint
 
 --The environment must be returned for the parser to use.
 cf2flex :: Maybe String -> String -> CF -> (String, SymEnv)
@@ -52,7 +54,7 @@
   restOfFlex inPackage cf env'
  ], env')
   where
-   env = makeSymEnv (symbols cf ++ reservedWords cf) (0 :: Int)
+   env = makeSymEnv (cfgSymbols cf ++ reservedWords cf) (0 :: Int)
    env' = env ++ (makeSymEnv (tokenNames cf) (length env))
    makeSymEnv [] _ = []
    makeSymEnv (s:symbs) n = (s, nsDefine inPackage "_SYMB_" ++ (show n)) : (makeSymEnv symbs (n+1))
@@ -81,20 +83,6 @@
    "%}"
   ]
 
---For now all categories are included.
---Optimally only the ones that are used should be generated.
-cMacros :: String
-cMacros = unlines
-  [
-  "LETTER [a-zA-Z]",
-  "CAPITAL [A-Z]",
-  "SMALL [a-z]",
-  "DIGIT [0-9]",
-  "IDENT [a-zA-Z0-9'_]",
-  "%START YYINITIAL COMMENT CHAR CHARESC CHAREND STRING ESCAPED",
-  "%%"
-  ]
-
 lexSymbols :: SymEnv -> String
 lexSymbols ss = concatMap transSym ss
   where
@@ -106,7 +94,8 @@
 restOfFlex :: Maybe String -> CF -> SymEnv -> String
 restOfFlex inPackage cf env = concat
   [
-   lexComments inPackage (comments cf),
+   render $ lexComments inPackage (comments cf),
+   "\n\n",
    userDefTokens,
    ifC catString strStates,
    ifC catChar chStates,
@@ -154,31 +143,9 @@
     ]
    footer = unlines
     [
-     "int " ++ ns ++ "initialize_lexer(FILE *inp) { yyrestart(inp); BEGIN YYINITIAL; }",
+     "void " ++ ns ++ "initialize_lexer(FILE *inp) { yyrestart(inp); BEGIN YYINITIAL; }",
      "int yywrap(void) { return 1; }"
     ]
-
-
-lexComments :: Maybe String -> ([(String, String)], [String]) -> String
-lexComments inPackage (m,s) =
-  (unlines (map (lexSingleComment inPackage) s))
-  ++ (unlines (map (lexMultiComment inPackage) m))
-
-lexSingleComment :: Maybe String -> String -> String
-lexSingleComment inPackage c =
-  "<YYINITIAL>\"" ++ c ++ "\"[^\\n]*\\n  ++" ++ nsString inPackage ++ "yy_mylinenumber ; \t /* BNFC single-line comment */;"
-
---There might be a possible bug here if a language includes 2 multi-line comments.
---They could possibly start a comment with one character and end it with another.
---However this seems rare.
-lexMultiComment :: Maybe String -> (String, String) -> String
-lexMultiComment inPackage (b,e) = unlines [
-  "<YYINITIAL>\"" ++ b ++ "\"      \t BEGIN COMMENT;",
-  "<COMMENT>\"" ++ e ++ "\"      \t BEGIN YYINITIAL;",
-  "<COMMENT>.      \t /* BNFC multi-line comment */;",
-  "<COMMENT>[\\n]   ++" ++ nsString inPackage ++ "yy_mylinenumber ; \t /* BNFC multi-line comment */;"
- ---- "\\n  ++yy_mylinenumber ;"
-  ]
 
 
 --Helper function that escapes characters in strings
diff --git a/src/BNFC/Backend/CPP/PrettyPrinter.hs b/src/BNFC/Backend/CPP/PrettyPrinter.hs
--- a/src/BNFC/Backend/CPP/PrettyPrinter.hs
+++ b/src/BNFC/Backend/CPP/PrettyPrinter.hs
@@ -1,3 +1,5 @@
+{-# LANGUAGE NoImplicitPrelude #-}
+
 {-
    **************************************************************
     BNF Converter Module
@@ -22,6 +24,8 @@
 
 module BNFC.Backend.CPP.PrettyPrinter (cf2CPPPrinter, prRender) where
 
+import Prelude'
+
 import BNFC.CF
 import BNFC.Utils ((+++))
 import BNFC.Backend.Common
@@ -82,14 +86,14 @@
     "  /* The following are simple heuristics for rendering terminals */",
     "  /* You may wish to change them */",
     "  void render(Char c);",
-    "  void render(String s);",
-    if useStl then "void render(char* s);" else "",
+    if useStl then "  void render(String s);" else "",
+    "  void render(const char *s);",
     "  void indent(void);",
     "  void backup(void);",
     " public:",
     "  PrintAbsyn(void);",
     "  ~PrintAbsyn(void);",
-    "  char* print(Visitable* v);"
+    "  char *print(Visitable *v);"
    ]
   hdef = nsDefine inPackage "PRINTER_HEADER"
   classFooter = unlines $
@@ -102,14 +106,17 @@
    ] ++ ["  void visit" ++ t ++ "(String s);" | t <- tokenNames cf] ++
    [
     " protected:",
-    "  void inline bufAppend(const char* s)",
+    "  char *buf_;",
+    "  int cur_, buf_size;",
+    "",
+    "  void inline bufAppend(const char *s)",
     "  {",
     "    int len = strlen(s);",
-    "    while (cur_ + len > buf_size)",
+    "    while (cur_ + len >= buf_size)",
     "    {",
     "      buf_size *= 2; /* Double the buffer size */",
-    "      resizeBuffer();",
     "    }",
+    "    resizeBuffer();",
     "    for(int n = 0; n < len; n++)",
     "    {",
     "      buf_[cur_ + n] = s[n];",
@@ -117,9 +124,10 @@
     "    cur_ += len;",
     "    buf_[cur_] = 0;",
     "  }",
+    "",
     "  void inline bufAppend(const char c)",
     "  {",
-    "    if (cur_ == buf_size)",
+    "    if (cur_ >= buf_size)",
     "    {",
     "      buf_size *= 2; /* Double the buffer size */",
     "      resizeBuffer();",
@@ -128,17 +136,24 @@
     "    cur_++;",
     "    buf_[cur_] = 0;",
     "  }",
+    "",
     if useStl then render (nest 2 bufAppendString) else "",
     "  void inline bufReset(void)",
     "  {",
-    "    cur_ = 0;",
+    "    if (buf_) free(buf_);",
     "    buf_size = " ++ nsDefine inPackage "BUFFER_INITIAL" ++ ";",
-    "    resizeBuffer();",
+    "    buf_ = (char *) malloc(buf_size);",
+    "    if (!buf_) {",
+    "      fprintf(stderr, \"Error: Out of memory while allocating buffer!\\n\");",
+    "      exit(1);",
+    "    }",
     "    memset(buf_, 0, buf_size);",
+    "    cur_ = 0;",
     "  }",
+    "",
     "  void inline resizeBuffer(void)",
     "  {",
-    "    char* temp = (char*) malloc(buf_size);",
+    "    char *temp = (char *) malloc(buf_size);",
     "    if (!temp)",
     "    {",
     "      fprintf(stderr, \"Error: Out of memory while attempting to grow buffer!\\n\");",
@@ -151,8 +166,6 @@
     "    }",
     "    buf_ = temp;",
     "  }",
-    "  char *buf_;",
-    "  int cur_, buf_size;",
     "};",
     ""
    ]
@@ -160,7 +173,7 @@
   bufAppendString =
       "void inline bufAppend(String str)"
       $$ codeblock 2
-          [ "const char* s = str.c_str();"
+          [ "const char *s = str.c_str();"
           , "bufAppend(s);"]
   showHeader = unlines
    [
@@ -170,7 +183,7 @@
     " public:",
     "  ShowAbsyn(void);",
     "  ~ShowAbsyn(void);",
-    "  char* show(Visitable* v);"
+    "  char *show(Visitable *v);"
    ]
   footer = unlines
    [
@@ -183,7 +196,7 @@
 prDataH :: (Cat, [Rule]) -> String
 prDataH (cat, rules) =
  if isList cat
- then concat ["  void visit", cl, "(", cl, "* p);\n"]
+ then concat ["  void visit", cl, "(", cl, " *p);\n"]
  else abstract ++ concatMap prRuleH rules
  where
    cl = identCat (normCat cat)
@@ -239,13 +252,14 @@
       "{",
       "}",
       "",
-      "char* PrintAbsyn::print(Visitable *v)",
+      "char *PrintAbsyn::print(Visitable *v)",
       "{",
       "  _i_ = 0; _n_ = 0;",
       "  bufReset();",
       "  v->accept(this);",
       "  return buf_;",
-      "}"
+      "}",
+      ""
      ]
     showEntries = unlines
      [
@@ -259,12 +273,13 @@
       "{",
       "}",
       "",
-      "char* ShowAbsyn::show(Visitable *v)",
+      "char *ShowAbsyn::show(Visitable *v)",
       "{",
       "  bufReset();",
       "  v->accept(this);",
       "  return buf_;",
-      "}"
+      "}",
+      ""
      ]
     printBasics = unlines
      [
@@ -274,24 +289,28 @@
       "  sprintf(tmp, \"%d\", i);",
       "  bufAppend(tmp);",
       "}",
+      "",
       "void PrintAbsyn::visitDouble(Double d)",
       "{",
       "  char tmp[16];",
       "  sprintf(tmp, \"%g\", d);",
       "  bufAppend(tmp);",
       "}",
+      "",
       "void PrintAbsyn::visitChar(Char c)",
       "{",
       "  bufAppend('\\'');",
       "  bufAppend(c);",
       "  bufAppend('\\'');",
       "}",
+      "",
       "void PrintAbsyn::visitString(String s)",
       "{",
       "  bufAppend('\\\"');",
       "  bufAppend(s);",
       "  bufAppend('\\\"');",
       "}",
+      "",
       "void PrintAbsyn::visitIdent(String s)",
       "{",
       "  render(s);",
@@ -368,17 +387,18 @@
 prPrintData _ inPackage cf (cat, rules) = -- Not a list
  -- a position token
  if isPositionCat cf cat then unlines [
-   "void PrintAbsyn::visit" ++ show cat ++ "(" ++ show cat ++ "* p)",
+   "void PrintAbsyn::visit" ++ show cat ++ "(" ++ show cat ++ " *p)",
    "{",
    "  visitIdent(p->string_);",
-   "}"
+   "}",
+   ""
    ]
  else abstract ++ concatMap (prPrintRule inPackage) rules
  where
    cl = identCat (normCat cat)
    abstract = case lookupRule (show cat) rules of
     Just _ -> ""
-    Nothing ->  "void PrintAbsyn::visit" ++ cl ++ "(" ++ cl ++ "*p) {} //abstract class\n\n"
+    Nothing ->  "void PrintAbsyn::visit" ++ cl ++ "(" ++ cl +++ "*p) {} //abstract class\n\n"
 
 -- | Generate pretty printer visitor for a list category:
 --
@@ -437,7 +457,7 @@
 genPrintVisitorListNoStl (cat@(ListCat c), rules) = unlines
     [ "void PrintAbsyn::visit" ++ cl ++ "("++ cl ++ " *" ++ vname ++ ")"
     , "{"
-    , "  while(" ++ vname ++ "!= 0)"
+    , "  while(" ++ vname +++ "!= 0)"
     , "  {"
     , "    if (" ++ vname ++ "->" ++ vname ++ "_ == 0)"
     , "    {"
@@ -474,14 +494,15 @@
 prPrintRule :: Maybe String -> Rule -> String
 prPrintRule inPackage r@(Rule fun _ cats) | isProperLabel fun = unlines
   [
-   "void PrintAbsyn::visit" ++ fun ++ "(" ++ fun ++ "*" +++ fnm ++ ")",
+   "void PrintAbsyn::visit" ++ fun ++ "(" ++ fun +++ "*" ++ fnm ++ ")",
    "{",
    "  int oldi = _i_;",
    lparen,
    cats',
    rparen,
    "  _i_ = oldi;",
-   "}\n"
+   "}",
+   ""
   ]
    where
     p = precRule r
@@ -498,7 +519,7 @@
   where t' = snd (renderCharOrString t)
 prPrintCat fnm (Left (c, nt))
   | isTokenCat c  = "  visit" ++ funName c ++ "(" ++ fnm ++ "->" ++ render nt ++ ");\n"
-  | isList c            = "  if(" ++ fnm ++ "->" ++ render nt ++ ") {" ++ accept ++ "}"
+  | isList c            = "  if(" ++ fnm ++ "->" ++ render nt ++ ") {" ++ accept ++ "}\n"
   | otherwise           = "  " ++ accept ++ "\n"
   where
     accept
@@ -563,13 +584,13 @@
     cl = identCat (normCat cat)
     abstract = case lookupRule (show cat) rules of
       Just _ -> ""
-      Nothing ->  "void ShowAbsyn::visit" ++ cl ++ "(" ++ cl ++ "* p) {} //abstract class\n\n"
+      Nothing ->  "void ShowAbsyn::visit" ++ cl ++ "(" ++ cl ++ " *p) {} //abstract class\n\n"
 
 --This prints all the methods for Abstract Syntax tree rules.
 prShowRule :: Rule -> String
 prShowRule (Rule fun _ cats) | isProperLabel fun = concat
   [
-   "void ShowAbsyn::visit" ++ fun ++ "(" ++ fun ++ "*" +++ fnm ++ ")\n",
+   "void ShowAbsyn::visit" ++ fun ++ "(" ++ fun +++ "*" ++ fnm ++ ")\n",
    "{\n",
    lparen,
    "  bufAppend(\"" ++ fun ++ "\");\n",
@@ -692,6 +713,7 @@
       "     bufAppend(' ');",
       "  }",
       "}",
+      "",
       let renderString = "void PrintAbsyn::render(String s_)" $$ codeblock 2
                              [ "const char *s = s_.c_str() ;"
                              , "if(strlen(s) > 0)"
@@ -699,7 +721,7 @@
                                  [ "bufAppend(s);"
                                  , "bufAppend(' ');" ] ]
       in if useStl then render renderString else "",
-      "void PrintAbsyn::render(char* s)",
+      "void PrintAbsyn::render(const char *s)",
       "{",
       "  if(strlen(s) > 0)",
       "  {",
@@ -707,6 +729,7 @@
       "    bufAppend(' ');",
       "  }",
       "}",
+      "",
       "void PrintAbsyn::indent()",
       "{",
       "  int n = _n_;",
@@ -716,6 +739,7 @@
       "    n--;",
       "  }",
       "}",
+      "",
       "void PrintAbsyn::backup()",
       "{",
       "  if (buf_[cur_ - 1] == ' ')",
@@ -723,5 +747,6 @@
       "    buf_[cur_ - 1] = 0;",
       "    cur_--;",
       "  }",
-      "}"
+      "}",
+      ""
   ]
diff --git a/src/BNFC/Backend/CPP/STL.hs b/src/BNFC/Backend/CPP/STL.hs
--- a/src/BNFC/Backend/CPP/STL.hs
+++ b/src/BNFC/Backend/CPP/STL.hs
@@ -16,7 +16,7 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 module BNFC.Backend.CPP.STL (makeCppStl,) where
@@ -25,6 +25,7 @@
 import BNFC.CF
 import BNFC.Options
 import BNFC.Backend.Base
+import BNFC.Backend.CPP.Makefile
 import BNFC.Backend.CPP.STL.CFtoSTLAbs
 import BNFC.Backend.CPP.NoSTL.CFtoFlex
 import BNFC.Backend.CPP.STL.CFtoBisonSTL
@@ -55,49 +56,6 @@
     Makefile.mkMakefile opts $ makefile name
   where name = lang opts
 
-makefile :: String -> String
-makefile name =
-  (unlines [ "CC = g++",
-             "CCFLAGS = -g -W -Wall", "",
-             "FLEX = flex",
-             "FLEX_OPTS = -P" ++ name, "",
-             "BISON = bison",
-             "BISON_OPTS = -t -p" ++ name, "",
-             "OBJS = Absyn.o Lexer.o Parser.o Printer.o", "" ] ++)
-  $ Makefile.mkRule ".PHONY" ["clean", "distclean"]
-    []
-  $ Makefile.mkRule "all" [testName]
-    []
-  $ Makefile.mkRule "clean" []
-   -- peteg: don't nuke what we generated - move that to the "vclean" target.
-    [ "rm -f *.o " ++ testName ++ " " ++ unwords
-      [ name ++ e | e <- [".aux", ".log", ".pdf",".dvi", ".ps", ""]] ]
-  $ Makefile.mkRule "distclean" ["clean"]
-    [ "rm -f " ++ unwords
-      [ "Absyn.C", "Absyn.H", "Test.C", "Parser.C", "Parser.H", "Lexer.C",
-        "Skeleton.C", "Skeleton.H", "Printer.C", "Printer.H", "Makefile " ]
-      ++ name ++ ".l " ++ name ++ ".y " ++ name ++ ".tex "]
-  $ Makefile.mkRule (testName) [ "${OBJS}", "Test.o" ]
-   [ "@echo \"Linking " ++ testName ++ "...\""
-   , "${CC} ${CCFLAGS} ${OBJS} Test.o -o " ++ testName ]
-  $ Makefile.mkRule "Absyn.o" [ "Absyn.C", "Absyn.H" ]
-   [ "${CC} ${CCFLAGS} -c Absyn.C" ]
-  $ Makefile.mkRule "Lexer.C" [ name ++ ".l" ]
-   [ "${FLEX} -oLexer.C " ++ name ++ ".l" ]
-  $ Makefile.mkRule "Parser.C" [ name ++ ".y" ]
-   [ "${BISON} " ++ name ++ ".y -o Parser.C" ]
-  $ Makefile.mkRule "Lexer.o" [ "Lexer.C", "Parser.H" ]
-   [ "${CC} ${CCFLAGS} -c Lexer.C" ]
-  $ Makefile.mkRule "Parser.o" [ "Parser.C", "Absyn.H" ]
-   [ "${CC} ${CCFLAGS} -c Parser.C" ]
-  $ Makefile.mkRule "Printer.o" [ "Printer.C", "Printer.H", "Absyn.H" ]
-   [ "${CC} ${CCFLAGS} -c Printer.C" ]
-  $ Makefile.mkRule "Skeleton.o" [ "Skeleton.C", "Skeleton.H", "Absyn.H" ]
-   [ "${CC} ${CCFLAGS} -c Skeleton.C" ]
-  $ Makefile.mkRule "Test.o" [ "Test.C", "Parser.H", "Printer.H", "Absyn.H" ]
-   [ "${CC} ${CCFLAGS} -c Test.C" ]
-  ""
-  where testName = "Test" ++ name
 
 cpptest :: Maybe String -> CF -> String
 cpptest inPackage cf =
@@ -110,34 +68,60 @@
     "/*                                                                          */",
     "/****************************************************************************/",
     "#include <stdio.h>",
+    "#include <string.h>",
     "#include \"Parser.H\"",
     "#include \"Printer.H\"",
     "#include \"Absyn.H\"",
     "",
+    "void usage() {",
+    "  printf(\"usage: Call with one of the following argument " ++
+      "combinations:\\n\");",
+    "  printf(\"\\t--help\\t\\tDisplay this help message.\\n\");",
+    "  printf(\"\\t(no arguments)\tParse stdin verbosely.\\n\");",
+    "  printf(\"\\t(files)\\t\\tParse content of files verbosely.\\n\");",
+    "  printf(\"\\t-s (files)\\tSilent mode. Parse content of files " ++
+      "silently.\\n\");",
+    "}",
+    "",
     "int main(int argc, char ** argv)",
     "{",
     "  FILE *input;",
-    "  if (argc > 1) ",
-    "  {",
-    "    input = fopen(argv[1], \"r\");",
-    "    if (!input)",
-    "    {",
-    "      fprintf(stderr, \"Error opening input file.\\n\");",
-    "      exit(1);",
+    "  int quiet = 0;",
+    "  char *filename = NULL;",
+    "",
+    "  if (argc > 1) {",
+    "    if (strcmp(argv[1], \"-s\") == 0) {",
+    "      quiet = 1;",
+    "      if (argc > 2) {",
+    "        filename = argv[2];",
+    "      } else {",
+    "        input = stdin;",
+    "      }",
+    "    } else {",
+    "      filename = argv[1];",
     "    }",
     "  }",
-    "  else input = stdin;",
+    "",
+    "  if (filename) {",
+    "    input = fopen(filename, \"r\");",
+    "    if (!input) {",
+    "      usage();",
+    "      exit(1);",
+    "    }",
+    "  } else input = stdin;",
     "  /* The default entry point is used. For other options see Parser.H */",
     "  " ++ scope ++ def ++ " *parse_tree = " ++ scope ++ "p" ++ def ++ "(input);",
     "  if (parse_tree)",
     "  {",
     "    printf(\"\\nParse Succesful!\\n\");",
-    "    printf(\"\\n[Abstract Syntax]\\n\");",
-    "    " ++ scope ++ "ShowAbsyn *s = new " ++ scope ++ "ShowAbsyn();",
-    "    printf(\"%s\\n\\n\", s->show(parse_tree));",
-    "    printf(\"[Linearized Tree]\\n\");",
-    "    " ++ scope ++ "PrintAbsyn *p = new " ++ scope ++ "PrintAbsyn();",
-    "    printf(\"%s\\n\\n\", p->print(parse_tree));",
+    "    if (!quiet) {",
+    "      printf(\"\\n[Abstract Syntax]\\n\");",
+    "      " ++ scope ++ "ShowAbsyn *s = new " ++ scope ++ "ShowAbsyn();",
+    "      printf(\"%s\\n\\n\", s->show(parse_tree));",
+    "      printf(\"[Linearized Tree]\\n\");",
+    "      " ++ scope ++ "PrintAbsyn *p = new " ++ scope ++ "PrintAbsyn();",
+    "      printf(\"%s\\n\\n\", p->print(parse_tree));",
+    "    }",
     "    return 0;",
     "  }",
     "  return 1;",
@@ -164,7 +148,7 @@
   "  char char_;",
   "  double double_;",
   "  char* string_;",
-  (concatMap mkVar cats) ++ "} YYSTYPE;",
+  concatMap mkVar cats ++ "} YYSTYPE;",
   "",
   concatMap mkFuncs eps,
   nsEnd inPackage,
@@ -177,12 +161,12 @@
  ]
  where
   hdef = nsDefine inPackage "PARSER_HEADER_FILE"
-  mkForwardDec s | (normCat s == s) = "class " ++ (identCat s) ++ ";\n"
+  mkForwardDec s | normCat s == s = "class " ++ identCat s ++ ";\n"
   mkForwardDec _ = ""
-  mkVar s | (normCat s == s) = "  " ++ (identCat s) ++"*" +++ (map toLower (identCat s)) ++ "_;\n"
+  mkVar s | normCat s == s = "  " ++ identCat s ++"*" +++ map toLower (identCat s) ++ "_;\n"
   mkVar _ = ""
   mkDefines n [] = mkString n
-  mkDefines n ((_,s):ss) = ("#define " ++ s +++ (show n) ++ "\n") ++ (mkDefines (n+1) ss) -- "nsDefine inPackage s" not needed (see cf2flex::makeSymEnv)
+  mkDefines n ((_,s):ss) = "#define " ++ s +++ show n ++ "\n" ++ mkDefines (n+1) ss -- "nsDefine inPackage s" not needed (see cf2flex::makeSymEnv)
   mkString n =  if isUsedCat cf catString
    then ("#define " ++ nsDefine inPackage "_STRING_ " ++ show n ++ "\n") ++ mkChar (n+1)
    else mkChar n
@@ -196,7 +180,7 @@
    then ("#define " ++ nsDefine inPackage "_DOUBLE_ " ++ show n ++ "\n") ++ mkIdent(n+1)
    else mkIdent n
   mkIdent n =  if isUsedCat cf catIdent
-   then ("#define " ++ nsDefine inPackage "_IDENT_ " ++ show n ++ "\n")
+   then "#define " ++ nsDefine inPackage "_IDENT_ " ++ show n ++ "\n"
    else ""
   mkFuncs s | normCat s == s = identCat s ++ "*" +++ "p" ++ identCat s ++ "(FILE *inp);\n" ++
                                identCat s ++ "*" +++ "p" ++ identCat s ++ "(const char *str);\n"
diff --git a/src/BNFC/Backend/CPP/STL/CFtoBisonSTL.hs b/src/BNFC/Backend/CPP/STL/CFtoBisonSTL.hs
--- a/src/BNFC/Backend/CPP/STL/CFtoBisonSTL.hs
+++ b/src/BNFC/Backend/CPP/STL/CFtoBisonSTL.hs
@@ -1,3 +1,5 @@
+{-# LANGUAGE NoImplicitPrelude #-}
+
 {-
     BNF Converter: C++ Bison generator
     Copyright (C) 2004  Author:  Michael Pellauer
@@ -14,7 +16,7 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 {-
@@ -22,9 +24,9 @@
     BNF Converter Module
 
     Description   : This module generates the Bison input file using
-		    STL. The main difference to CFtoBison is in handling
+                    STL. The main difference to CFtoBison is in handling
                     lists: by using std::vector and push_back, our rules
-		    for reverting lists are the opposite to linked lists.
+                    for reverting lists are the opposite to linked lists.
                     Note that because of the way bison stores results
                     the programmer can increase performance by limiting
                     the number of entry points in their grammar.
@@ -44,16 +46,21 @@
 
 module BNFC.Backend.CPP.STL.CFtoBisonSTL (cf2Bison, union) where
 
-import BNFC.CF
-import Data.List (intersperse, nub)
-import BNFC.Backend.Common.NamedVariables hiding (varName)
+import Prelude'
+
 import Data.Char (toLower,isUpper)
-import BNFC.Utils ((+++))
-import BNFC.TypeChecker
-import ErrM
-import BNFC.Backend.CPP.STL.STLUtils
+import Data.List (nub, intercalate)
+import Data.Maybe (fromMaybe)
+
 import BNFC.Backend.C.CFtoBisonC (startSymbol)
+import BNFC.Backend.CPP.STL.STLUtils
+import BNFC.Backend.Common.NamedVariables hiding (varName)
+import BNFC.CF
+import BNFC.Options (RecordPositions(..))
 import BNFC.PrettyPrint
+import BNFC.TypeChecker
+import BNFC.Utils ((+++))
+import ErrM
 
 --This follows the basic structure of CFtoHappy.
 
@@ -64,19 +71,19 @@
 type MetaVar     = String
 
 --The environment comes from the CFtoFlex
-cf2Bison :: Bool -> Maybe String -> String -> CF -> SymEnv -> String
-cf2Bison ln inPackage name cf env
+cf2Bison :: RecordPositions -> Maybe String -> String -> CF -> SymEnv -> String
+cf2Bison rp inPackage name cf env
  = unlines
     [header inPackage name cf,
      render $ union inPackage (positionCats cf ++ allCats cf),
-     maybe "" (\ns -> "%name-prefix=\"" ++ ns ++ "yy\"") inPackage,
+     maybe "" (\ns -> "%define api.prefix {" ++ ns ++ "yy}") inPackage,
      "%token _ERROR_",
      tokens user env,
      declarations cf,
      startSymbol cf,
      specialToks cf,
      "%%",
-     prRules (rulesForBison ln inPackage name cf env)
+     prRules (rulesForBison rp inPackage name cf env)
     ]
   where
    user = fst (unzip (tokenPragmas cf))
@@ -86,88 +93,86 @@
 
 header :: Maybe String -> String -> CF -> String
 header inPackage name cf = unlines
-         ["/* This Bison file was machine-generated by BNFC */",
-	  "%{",
-	  "#include <stdlib.h>",
-	  "#include <stdio.h>",
-	  "#include <string.h>",
-	  "#include <iostream>",
-          "#include <algorithm>",
-	  "#include \"Absyn.H\"",
-	  "typedef struct yy_buffer_state *YY_BUFFER_STATE;",
-	  "int yyparse(void);",
-	  "int yylex(void);",
-	  "YY_BUFFER_STATE " ++ ns ++ "yy_scan_string(const char *str);",
-	  "void " ++ ns ++ "yy_delete_buffer(YY_BUFFER_STATE buf);",
-	  "int " ++ ns ++ "yy_mylinenumber;",  --- hack to get line number. AR 2006
-	  "int " ++ ns ++ "initialize_lexer(FILE * inp);",
-          "int " ++ ns ++ "yywrap(void)",
-          "{",
-          "  return 1;",
-	  "}",
-          "void " ++ ns ++ "yyerror(const char *str)",
-          "{",
-          "  extern char *yytext;",
-          "  fprintf(stderr,\"error: line %d: %s at %s\\n\", ",
-          "    yy_mylinenumber, str, yytext);",
-          "}",
-	  "",
-	  definedRules cf,
-	  nsStart inPackage,
-	  unlines $ map (parseMethod inPackage name) (allCatsNorm cf ++ positionCats cf),  -- (allEntryPoints cf), M.F. 2004-09-14 fix of [Ty2] bug.
-	  nsEnd inPackage,
-	  "%}"
-	  ]
+    [ "/* This Bison file was machine-generated by BNFC */"
+    , "%{"
+    , "#include <stdlib.h>"
+    , "#include <stdio.h>"
+    , "#include <string.h>"
+    , "#include <algorithm>"
+    , "#include \"Absyn.H\""
+    , "typedef struct yy_buffer_state *YY_BUFFER_STATE;"
+    , "int yyparse(void);"
+    , "int yylex(void);"
+    , "YY_BUFFER_STATE " ++ ns ++ "yy_scan_string(const char *str);"
+    , "void " ++ ns ++ "yy_delete_buffer(YY_BUFFER_STATE buf);"
+    , "int " ++ ns ++ "yy_mylinenumber;"  --- hack to get line number. AR 2006
+    , "int " ++ ns ++ "initialize_lexer(FILE * inp);"
+    , "int " ++ ns ++ "yywrap(void)"
+    , "{"
+    , "  return 1;"
+    , "}"
+    , "void " ++ ns ++ "yyerror(const char *str)"
+    , "{"
+    , "  extern char *"++ns++"yytext;"
+    , "  fprintf(stderr,\"error: line %d: %s at %s\\n\", "
+    , "    "++ns++"yy_mylinenumber, str, "++ns++"yytext);"
+    , "}"
+    , ""
+    , definedRules cf
+    , nsStart inPackage
+    , unlines $ map (parseMethod inPackage name) (allCatsNorm cf ++ positionCats cf)  -- (allEntryPoints cf), M.F. 2004-09-14 fix of [Ty2] bug.
+    , nsEnd inPackage
+    , "%}"
+    ]
   where
    ns = nsString inPackage
 
 definedRules :: CF -> String
 definedRules cf =
-	unlines [ rule f xs e | FunDef f xs e <- pragmasOfCF cf ]
-    where
-	ctx = buildContext cf
-
-	list = LC (const "[]") (\t -> "List" ++ unBase t)
-	    where
-		unBase (ListT t) = unBase t
-		unBase (BaseT x) = show $ normCat $ strToCat x
+    unlines [ rule f xs e | FunDef f xs e <- cfgPragmas cf ]
+  where
+    ctx = buildContext cf
 
-	rule f xs e =
-	    case checkDefinition' list ctx f xs e of
-		Bad err	-> error $ "Panic! This should have been caught already:\n" ++ err
-		Ok (args,(e',t)) -> unlines
-		    [ cppType t ++ " " ++ f ++ "_ (" ++
-			concat (intersperse ", " $ map cppArg args) ++ ") {"
-		    , "  return " ++ cppExp e' ++ ";"
-		    , "}"
-		    ]
-	    where
+    list = LC (const "[]") (\ t -> "List" ++ unBase t)
+      where
+        unBase (ListT t) = unBase t
+        unBase (BaseT x) = show $ normCat $ strToCat x
 
-		cppType :: Base -> String
-		cppType (ListT (BaseT x)) = "List" ++ show (normCat $ strToCat x) ++ " *"
-		cppType (ListT t)	   = cppType t ++ " *"
-		cppType (BaseT x)
-		    | isToken x ctx = "String"
-		    | otherwise	    = (show $ normCat $ strToCat x) ++ " *"
+    rule f xs e =
+        case checkDefinition' list ctx f xs e of
+        Bad err -> error $ "Panic! This should have been caught already:\n" ++ err
+        Ok (args,(e',t)) -> unlines
+            [ cppType t ++ " " ++ f ++ "_ (" ++
+                intercalate ", " (map cppArg args) ++ ") {"
+            , "  return " ++ cppExp e' ++ ";"
+            , "}"
+            ]
+      where
+        cppType :: Base -> String
+        cppType (ListT (BaseT x)) = "List" ++ show (normCat $ strToCat x) ++ " *"
+        cppType (ListT t)         = cppType t ++ " *"
+        cppType (BaseT x)
+            | isToken x ctx = "String"
+            | otherwise     = show (normCat $ strToCat x) ++ " *"
 
-		cppArg :: (String, Base) -> String
-		cppArg (x,t) = cppType t ++ " " ++ x ++ "_"
+        cppArg :: (String, Base) -> String
+        cppArg (x,t) = cppType t ++ " " ++ x ++ "_"
 
-		cppExp :: Exp -> String
-		cppExp (App "[]" []) = "0"
-		cppExp (App x [])
-		    | elem x xs		= x ++ "_"	-- argument
-		cppExp (App t [e])
-		    | isToken t ctx	= cppExp e
-		cppExp (App x es)
-		    | isUpper (head x)	= call ("new " ++ x) es
-		    | otherwise		= call (x ++ "_") es
-		cppExp (LitInt n)	= show n
-		cppExp (LitDouble x)	= show x
-		cppExp (LitChar c)	= show c
-		cppExp (LitString s)	= show s
+        cppExp :: Exp -> String
+        cppExp (App "[]" []) = "0"
+        cppExp (App x [])
+            | x `elem` xs         = x ++ "_"  -- argument
+        cppExp (App t [e])
+            | isToken t ctx     = cppExp e
+        cppExp (App x es)
+            | isUpper (head x)  = call ("new " ++ x) es
+            | otherwise         = call (x ++ "_") es
+        cppExp (LitInt n)       = show n
+        cppExp (LitDouble x)    = show x
+        cppExp (LitChar c)      = show c
+        cppExp (LitString s)    = show s
 
-		call x es = x ++ "(" ++ concat (intersperse ", " $ map cppExp es) ++ ")"
+        call x es = x ++ "(" ++ intercalate ", " (map cppExp es) ++ ")"
 
 
 --This generates a parser method for each entry point.
@@ -178,7 +183,7 @@
   -- else
   unlines
   [
-   "static " ++ cat' ++ "*" +++ (resultName cat') +++ "= 0;",
+   "static " ++ cat' ++ "*" +++ resultName cat' +++ "= 0;",
    cat' ++"* p" ++ cat' ++ "(FILE *inp)",
    "{",
    "  " ++ ns ++ "yy_mylinenumber = 1;",       -- O.F.
@@ -189,7 +194,7 @@
    "  }",
    "  else",
    "  { /* Success */",
-   "    return" +++ (resultName cat') ++ ";",
+   "    return" +++ resultName cat' ++ ";",
    "  }",
    "}",
    cat' ++"* p" ++ cat' ++ "(const char *str)",
@@ -207,7 +212,7 @@
    "  }",
    "  else",
    "  { /* Success */",
-   "    return" +++ (resultName cat') ++ ";",
+   "    return" +++ resultName cat' ++ ";",
    "  }",
    "}"
   ]
@@ -264,14 +269,15 @@
 declarations :: CF -> String
 declarations cf = concatMap (typeNT cf) (positionCats cf ++ allCats cf)
  where --don't define internal rules
-   typeNT cf nt | (isPositionCat cf nt || rulesForCat cf nt /= []) = "%type <" ++ (varName nt) ++ "> " ++ (identCat nt) ++ "\n"
+   typeNT cf nt | isPositionCat cf nt || rulesForCat cf nt /= [] =
+      "%type <" ++ varName nt ++ "> " ++ identCat nt ++ "\n"
    typeNT _ _ = ""
 
 --declares terminal types.
 tokens :: [UserDef] -> SymEnv -> String
-tokens user ts = concatMap (declTok user) ts
+tokens user = concatMap (declTok user)
  where
-  declTok u (s,r) = if elem s (map show u)
+  declTok u (s,r) = if s `elem` map show u
     then "%token<string_> " ++ r ++ "    //   " ++ s ++ "\n"
     else "%token " ++ r ++ "    //   " ++ s ++ "\n"
 
@@ -288,19 +294,19 @@
 
 --The following functions are a (relatively) straightforward translation
 --of the ones in CFtoHappy.hs
-rulesForBison :: Bool -> Maybe String -> String -> CF -> SymEnv -> Rules
-rulesForBison ln inPackage _ cf env = (map mkOne $ ruleGroups cf) ++ posRules where
-  mkOne (cat,rules) = constructRule ln inPackage cf env rules cat
+rulesForBison :: RecordPositions -> Maybe String -> String -> CF -> SymEnv -> Rules
+rulesForBison rp inPackage _ cf env = map mkOne (ruleGroups cf) ++ posRules where
+  mkOne (cat,rules) = constructRule rp inPackage cf env rules cat
   posRules = map mkPos $ positionCats cf
-  mkPos cat = (cat, [(maybe (show cat) id (lookup (show cat) env),
+  mkPos cat = (cat, [(fromMaybe (show cat) (lookup (show cat) env),
    "$$ = new " ++ show cat ++ "($1," ++ nsString inPackage ++ "yy_mylinenumber) ; YY_RESULT_" ++
    show cat ++ "_= $$ ;")])
 
 -- For every non-terminal, we construct a set of rules.
 constructRule ::
-  Bool -> Maybe String -> CF -> SymEnv -> [Rule] -> NonTerminal -> (NonTerminal,[(Pattern,Action)])
-constructRule ln inPackage cf env rules nt =
-  (nt,[(p,(generateAction ln inPackage nt (ruleName r) b m) +++ result) |
+  RecordPositions -> Maybe String -> CF -> SymEnv -> [Rule] -> NonTerminal -> (NonTerminal,[(Pattern,Action)])
+constructRule rp inPackage cf env rules nt =
+  (nt,[(p, generateAction rp inPackage nt (ruleName r) b m +++ result) |
      r0 <- rules,
      let (b,r) = if isConsFun (funRule r0) && elem (valCat r0) revs
                    then (True,revSepListRule r0)
@@ -311,33 +317,33 @@
      ---- "(:)" -> identCat nt
      ---- "(:[])" -> identCat nt
      z -> z
-   revs = reversibleCats cf
+   revs = cfgReversibleCats cf
    eps = allEntryPoints cf
-   isEntry nt = if elem nt eps then True else False
+   isEntry nt = nt `elem` eps
    result = if isEntry nt then (nsScope inPackage ++ resultName (identCat (normCat nt))) ++ "= $$;" else ""
 
 -- Generates a string containing the semantic action.
-generateAction :: Bool -> Maybe String -> NonTerminal -> Fun -> Bool -> [(MetaVar,Bool)] -> Action
-generateAction ln inPackage cat f b mbs =
+generateAction :: RecordPositions -> Maybe String -> NonTerminal -> Fun -> Bool -> [(MetaVar,Bool)] -> Action
+generateAction rp inPackage cat f b mbs =
   reverses ++
   if isCoercion f
-  then "$$ = " ++ (unwords ms) ++ ";"
-  else if (f == "[]")
+  then "$$ = " ++ unwords ms ++ ";"
+  else if f == "[]"
   then concat ["$$ = ","new ", scope, identCatV cat, "();"]
-  else if (f == "(:[])")
+  else if f == "(:[])"
   then concat ["$$ = ","new ", scope, identCatV cat, "() ; $$->push_back($1);"]
-  else if (f == "(:)" && b)
+  else if f == "(:)" && b
   then "$1->push_back("++ lastms ++ ") ; $$ = $1 ;"
-  else if (f == "(:)")
+  else if f == "(:)"
   then lastms ++ "->push_back(" ++ head ms ++ ") ; $$ = " ++ lastms ++ " ;" ---- not left rec
   else if isDefinedRule f
-  then concat ["$$ = ", scope, f, "_", "(", concat $ intersperse ", " ms, ");" ]
+  then concat ["$$ = ", scope, f, "_", "(", intercalate ", " ms, ");" ]
   else concat
-    ["$$ = ", "new ", scope, f, "(", (concat (intersperse ", " ms)), ");" ++ addLn ln]
+    ["$$ = ", "new ", scope, f, "(", intercalate ", " ms, ");" ++ addLn rp]
  where
   ms = map fst mbs
   lastms = last ms
-  addLn ln = if ln then " $$->line_number = " ++ nsString inPackage ++ "yy_mylinenumber;" else ""  -- O.F.
+  addLn rp = if rp == RecordPositions then " $$->line_number = " ++ nsString inPackage ++ "yy_mylinenumber;" else ""  -- O.F.
   identCatV = identCat . normCat
   reverses = unwords [
     "std::reverse(" ++ m ++"->begin(),"++m++"->end()) ;" |
@@ -355,16 +361,13 @@
      Left c -> case lookup (show c) env of
        Just x | not (isPositionCat cf c) -> x
        _ -> typeName (identCat c)
-     Right s -> case lookup s env of
-       Just x -> x
-       Nothing -> s
+     Right s -> fromMaybe s (lookup s env)
    metas its = [('$': show i,revert c) | (i,Left c) <- zip [1 :: Int ..] its]
 
    -- notice: reversibility with push_back vectors is the opposite
    -- of right-recursive lists!
-   revert c = (isList c) &&
-              not (isConsFun (funRule r)) && notElem c revs
-   revs = reversibleCats cf
+   revert c = isList c && not (isConsFun (funRule r)) && notElem c revs
+   revs = cfgReversibleCats cf
 
 -- We have now constructed the patterns and actions,
 -- so the only thing left is to merge them into one string.
@@ -372,12 +375,12 @@
 prRules :: Rules -> String
 prRules [] = []
 prRules ((_, []):rs) = prRules rs --internal rule
-prRules ((nt,((p,a):ls)):rs) =
-  (unwords [nt', ":" , p, "{ ", a, "}", "\n" ++ pr ls]) ++ ";\n" ++ prRules rs
+prRules ((nt, (p, a) : ls):rs) =
+    unwords [nt', ":" , p, "{ ", a, "}", "\n" ++ pr ls] ++ ";\n" ++ prRules rs
  where
   nt' = identCat nt
   pr []           = []
-  pr ((p,a):ls)   = (unlines [(concat $ intersperse " " ["  |", p, "{ ", a , "}"])]) ++ pr ls
+  pr ((p,a):ls)   = unlines [unwords ["  |", p, "{ ", a , "}"]] ++ pr ls
 
 --Some helper functions.
 resultName :: String -> String
@@ -394,5 +397,3 @@
 typeName "Integer" = "_INTEGER_"
 typeName "Double" = "_DOUBLE_"
 typeName x = x
-
-
diff --git a/src/BNFC/Backend/CPP/STL/CFtoCVisitSkelSTL.hs b/src/BNFC/Backend/CPP/STL/CFtoCVisitSkelSTL.hs
--- a/src/BNFC/Backend/CPP/STL/CFtoCVisitSkelSTL.hs
+++ b/src/BNFC/Backend/CPP/STL/CFtoCVisitSkelSTL.hs
@@ -14,7 +14,7 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 {-
@@ -41,8 +41,8 @@
 
 import BNFC.CF
 import BNFC.Utils ((+++))
-import Data.Char(toLower)
 import BNFC.Backend.Common.OOAbstract
+import BNFC.Backend.CPP.Naming
 import BNFC.Backend.CPP.STL.STLUtils
 
 --Produces (.H file, .C file)
@@ -66,9 +66,9 @@
   "class Skeleton : public Visitor",
   "{",
   "public:",
-  unlines ["  void visit" ++ b ++ "(" ++ b ++ "* p);" |
+  unlines ["  void visit" ++ b ++ "(" ++ b ++ " *p);" |
                               b <- classes, notElem b (defineds cf)],
-  unlines ["  void visit" ++ show b ++ "(" ++ show b ++  " x);" | b <- basics],
+  unlines ["  void visit" ++ b ++ "(" ++ b ++  " x);" | b <- basics],
   "};",
   nsEnd inPackage,
   "",
@@ -89,7 +89,7 @@
   nsStart inPackage,
   unlines [
     "void Skeleton::visit" ++ t ++ "(" ++
-       t ++ "* t) {} //abstract class" | t <- absclasses cf],
+       t ++ " *t) {} //abstract class" | t <- absclasses cf],
   unlines [prCon   r  | (_,rs)  <- signatures cf, r <- rs],
   unlines [prList  cb | cb <- listtypes cf],
   unlines [prBasic b  | b  <- tokentypes cf ++ map fst basetypes],
@@ -115,7 +115,7 @@
   ]
 
 prList (cl,b) = unlines [
-  "void Skeleton::visit" ++ cl ++ "("++ cl ++ "*" +++ vname ++ ")",
+  "void Skeleton::visit" ++ cl ++ "("++ cl +++ "*" ++ vname ++ ")",
   "{",
   "  for ("++ cl ++"::iterator i = " ++
        vname++"->begin() ; i != " ++vname ++"->end() ; ++i)",
@@ -127,7 +127,7 @@
   "}"
   ]
  where
-   vname = map toLower cl
+   vname = mkVariable cl
 
 prCon (f,cs) = unlines [
   "void Skeleton::visit" ++ f ++ "(" ++ f ++ " *" ++ v ++ ")",
@@ -138,9 +138,8 @@
   "}"
  ]
  where
-   v = map toLower f
+   v = mkVariable f
    visitArg (cat,isPt,var) =
      if isPt
        then (v ++ "->" ++ var ++ "->accept(this);")
        else ("visit" ++ cat ++ "(" ++ v ++ "->" ++ var ++ ");")
-
diff --git a/src/BNFC/Backend/CPP/STL/CFtoSTLAbs.hs b/src/BNFC/Backend/CPP/STL/CFtoSTLAbs.hs
--- a/src/BNFC/Backend/CPP/STL/CFtoSTLAbs.hs
+++ b/src/BNFC/Backend/CPP/STL/CFtoSTLAbs.hs
@@ -14,7 +14,7 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 {-
@@ -33,7 +33,7 @@
     Created       : 4 August, 2003
 
     Modified      : 22 May, 2004 / Antti-Juhani Kaijanaho
-	            29 August, 2006 / Aarne Ranta
+                    29 August, 2006 / Aarne Ranta
 
    **************************************************************
 -}
@@ -42,14 +42,15 @@
 
 import BNFC.Backend.Common.OOAbstract
 import BNFC.CF
+import BNFC.Options (RecordPositions(..))
 import BNFC.Utils((+++))
 import Data.List
 import BNFC.Backend.CPP.STL.STLUtils
 
 --The result is two files (.H file, .C file)
 
-cf2CPPAbs :: Bool -> Maybe String -> String -> CF -> (String, String)
-cf2CPPAbs ln inPackage _ cf = (mkHFile ln inPackage cab, mkCFile inPackage cab)
+cf2CPPAbs :: RecordPositions -> Maybe String -> String -> CF -> (String, String)
+cf2CPPAbs rp inPackage _ cf = (mkHFile rp inPackage cab, mkCFile inPackage cab)
   where
     cab = cf2cabs cf
 
@@ -57,8 +58,8 @@
 -- **** Header (.H) File Functions **** --
 
 --Makes the Header file.
-mkHFile :: Bool -> Maybe String -> CAbs -> String
-mkHFile ln inPackage cf = unlines
+mkHFile :: RecordPositions -> Maybe String -> CAbs -> String
+mkHFile rp inPackage cf = unlines
  [
   "#ifndef " ++ hdef,
   "#define " ++ hdef,
@@ -85,7 +86,7 @@
   "",
   "/********************   Abstract Syntax Classes    ********************/",
   "",
-  unlines [prAbs ln c | c <- absclasses cf],
+  unlines [prAbs rp c | c <- absclasses cf],
   "",
   unlines [prCon (c,r) | (c,rs) <- signatures cf, r <- rs],
   "",
@@ -125,13 +126,13 @@
   "};"
  ]
 
-prAbs :: Bool -> String -> String
-prAbs ln c = unlines [
+prAbs :: RecordPositions -> String -> String
+prAbs rp c = unlines [
   "class " ++ c ++ " : public Visitable",
   "{",
   "public:",
   "  virtual " ++ c ++ " *clone() const = 0;",
-  if ln then "  int line_number;" else "",
+  if rp == RecordPositions then "  int line_number;" else "",
   "};"
   ]
 
@@ -166,8 +167,7 @@
   "};"
   ]
  where
-   bas = drop 4 c ++ -- drop List
-	 if b then "*" else ""
+   bas = drop 4 c {- drop "List" -} ++ if b then "*" else ""
 
 
 -- **** Implementation (.C) File Functions **** --
@@ -177,7 +177,6 @@
   "//C++ Abstract Syntax Implementation generated by the BNF Converter.",
   "#include <algorithm>",
   "#include <string>",
-  "#include <iostream>",
   "#include <vector>",
   "#include \"Absyn.H\"",
   nsStart inPackage,
diff --git a/src/BNFC/Backend/CPP/STL/STLUtils.hs b/src/BNFC/Backend/CPP/STL/STLUtils.hs
--- a/src/BNFC/Backend/CPP/STL/STLUtils.hs
+++ b/src/BNFC/Backend/CPP/STL/STLUtils.hs
@@ -14,7 +14,7 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 module BNFC.Backend.CPP.STL.STLUtils where
diff --git a/src/BNFC/Backend/CSharp.hs b/src/BNFC/Backend/CSharp.hs
--- a/src/BNFC/Backend/CSharp.hs
+++ b/src/BNFC/Backend/CSharp.hs
@@ -16,7 +16,7 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 {-
    **************************************************************
@@ -49,7 +49,9 @@
 import BNFC.Backend.CSharp.CAbstoCSharpAbstractVisitSkeleton
 import BNFC.Backend.CSharp.CFtoCSharpPrinter
 import BNFC.Backend.CSharp.CSharpUtils
+import BNFC.PrettyPrint hiding ((<.>), (<>))
 import System.Environment (getEnv)
+import System.FilePath ((<.>))
 import System.Directory
 import System.IO
 import System.IO.Error (catchIOError)
@@ -57,7 +59,6 @@
 import Data.Maybe
 import Control.Monad (when)
 import qualified BNFC.Backend.Common.Makefile as Makefile
-import System.FilePath ((<.>))
 -- Control.Monad.State
 
 makeCSharp :: SharedOptions -> CF -> MkFiles ()
@@ -99,29 +100,29 @@
   liftIO $ putStrLn "-----------------------------------------------------------------------------"
   liftIO $ putStrLn ""
   where
-    makefile =
-      (unlines [ "MONO = mono", "MONOC = gmcs"
-               , "MONOCFLAGS = -optimize -reference:${PARSERREF}"
-               , "GPLEX = ${MONO} gplex.exe", "GPPG = ${MONO} gppg.exe"
-               , "PARSERREF = bin/ShiftReduceParser.dll"
-               , "CSFILES = Absyn.cs Parser.cs Printer.cs Scanner.cs Test.cs VisitSkeleton.cs AbstractVisitSkeleton.cs" ] ++)
-      $ Makefile.mkRule "all" [ "test" ]
-        []
-      $ Makefile.mkRule "clean" []
-        -- peteg: don't nuke what we generated - move that to the "vclean" target.
-        [ "rm -f " ++ namespace ++ ".pdf test" ]
-      $ Makefile.mkRule "distclean" [ "clean" ]
-        [ "rm -f ${CSFILES}"
-        , "rm -f " ++ unwords [namespace <.> ext | ext <- [ "l","y","tex" ]]
-        , "rm -f Makefile" ]
-      $ Makefile.mkRule "test" [ "Parser.cs", "Scanner.cs" ]
-        [ "@echo \"Compiling test...\""
-        , "${MONOC} ${MONOCFLAGS} -out:bin/test.exe ${CSFILES}" ]
-      $ Makefile.mkRule "Scanner.cs" [ namespace <.> "l" ]
-        [ "${GPLEX} /out:$@ " ++ namespace <.> "l" ]
-      $ Makefile.mkRule "Parser.cs" [ namespace <.> "y" ]
-        [ "${GPPG} /gplex " ++ namespace <.> "y > $@" ]
-      ""
+    makefile = vcat
+        ["MONO = mono", "MONOC = gmcs"
+        , "MONOCFLAGS = -optimize -reference:${PARSERREF}"
+        , "GPLEX = ${MONO} gplex.exe", "GPPG = ${MONO} gppg.exe"
+        , "PARSERREF = bin/ShiftReduceParser.dll"
+        , "CSFILES = Absyn.cs Parser.cs Printer.cs Scanner.cs Test.cs VisitSkeleton.cs AbstractVisitSkeleton.cs"
+        , Makefile.mkRule "all" [ "test" ]
+            []
+        , Makefile.mkRule "clean" []
+            -- peteg: don't nuke what we generated - move that to the "vclean" target.
+            [ "rm -f " ++ namespace ++ ".pdf test" ]
+        , Makefile.mkRule "distclean" [ "clean" ]
+            [ "rm -f ${CSFILES}"
+            , "rm -f " ++ unwords [namespace <.> ext | ext <- [ "l","y","tex" ]]
+            , "rm -f Makefile" ]
+        , Makefile.mkRule "test" [ "Parser.cs", "Scanner.cs" ]
+            [ "@echo \"Compiling test...\""
+            , "${MONOC} ${MONOCFLAGS} -out:bin/test.exe ${CSFILES}" ]
+        , Makefile.mkRule "Scanner.cs" [ namespace <.> "l" ]
+            [ "${GPLEX} /out:$@ " ++ namespace <.> "l" ]
+        , Makefile.mkRule "Parser.cs" [ namespace <.> "y" ]
+            [ "${GPPG} /gplex " ++ namespace <.> "y > $@" ]
+        ]
 
 writeVisualStudioFiles :: Namespace -> MkFiles ()
 writeVisualStudioFiles namespace = do
@@ -309,8 +310,7 @@
 projectguid :: MkFiles String
 projectguid = do
   maybeFilePath <- findDirectory
-  guid <- maybe getBadGUID getGoodGUID maybeFilePath
-  return guid
+  maybe getBadGUID getGoodGUID maybeFilePath
   where
     getBadGUID :: MkFiles String
     getBadGUID = do
diff --git a/src/BNFC/Backend/CSharp/CAbstoCSharpAbs.hs b/src/BNFC/Backend/CSharp/CAbstoCSharpAbs.hs
--- a/src/BNFC/Backend/CSharp/CAbstoCSharpAbs.hs
+++ b/src/BNFC/Backend/CSharp/CAbstoCSharpAbs.hs
@@ -16,7 +16,7 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 {-
@@ -76,7 +76,7 @@
  ]
   where
     -- an abstract class is a category which does not contain rules
-      abstractclasses = [ (cat, (map fst cabsrules)) | (cat, cabsrules) <- signatures cabs, cat `notElem` (map fst cabsrules) ]
+      abstractclasses = [ (cat, map fst cabsrules) | (cat, cabsrules) <- signatures cabs, cat `notElem` map fst cabsrules ]
 
 -- auxiliaries
 
@@ -142,13 +142,13 @@
   ]
 
 prVisitor :: Namespace -> [String] -> String
-prVisitor namespace funs = unlinesInline [
-  "    ",
-	"    public interface Visitor<R,A>",
-	"    {",
-	unlinesInline (map prVisitFun funs),
-	"    }"
-	]
+prVisitor namespace funs = unlinesInline
+  [ "    "
+  , "    public interface Visitor<R,A>"
+  , "    {"
+  , unlinesInline (map prVisitFun funs)
+  , "    }"
+  ]
   where
     prVisitFun f = "      R Visit(" ++ identifier namespace f ++ " p, A arg);"
 
@@ -164,7 +164,7 @@
   prEquals namespace f propnames,
   prHashCode namespace f propnames,
   -- print Accept method, override keyword needed for classes inheriting an abstract class
-  prAccept namespace c (if isAlsoCategory f c then Nothing else (Just " override")),
+  prAccept namespace c (if isAlsoCategory f c then Nothing else Just " override"),
   -- if this label is also a category, we need to print the Visitor interface
   -- (if not, it was already printed in the abstract class)
   if isAlsoCategory f c then prVisitor namespace [c] else "",
@@ -221,7 +221,7 @@
   ]
   where
     prEqualsVars [] = "true"
-    prEqualsVars vs = concat $ intersperse " && " $ map equalVar vs
+    prEqualsVars vs = intercalate " && " $ map equalVar vs
     equalVar v = "this." ++ v ++ ".Equals(obj." ++ v ++ ")"
 
 -- Creates the GetHashCode() method.
@@ -236,9 +236,8 @@
   where
     aPrime = 37
     prHashVars [] = show aPrime
-    prHashVars (v:vs) = prHashVars' (hashVar v) vs
-    prHashVars' r [] = r
-    prHashVars' r (v:vs) = prHashVars' (show aPrime ++ "*" ++ "(" ++ r ++ ")+" ++ hashVar v) vs
+    prHashVars (v:vs) =
+        foldl (\ r v -> show aPrime ++ "*" ++ "(" ++ r ++ ")+" ++ hashVar v) v vs
     hashVar var = "this." ++ var ++ ".GetHashCode()"
 
 prList :: Namespace -> (String,Bool) -> String
@@ -271,5 +270,5 @@
  where
    cvs = [c | (_,_,c,_) <- cs]
    pvs = ["p" ++ show i | ((_,_,_,_),i) <- zip cs [1..]]
-   conargs = concat $ intersperse ", "
+   conargs = intercalate ", "
      [identifier namespace (typename x) +++ v | ((x,_,_,_),v) <- zip cs pvs]
diff --git a/src/BNFC/Backend/CSharp/CAbstoCSharpAbstractVisitSkeleton.hs b/src/BNFC/Backend/CSharp/CAbstoCSharpAbstractVisitSkeleton.hs
--- a/src/BNFC/Backend/CSharp/CAbstoCSharpAbstractVisitSkeleton.hs
+++ b/src/BNFC/Backend/CSharp/CAbstoCSharpAbstractVisitSkeleton.hs
@@ -17,7 +17,7 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 {-
diff --git a/src/BNFC/Backend/CSharp/CAbstoCSharpVisitSkeleton.hs b/src/BNFC/Backend/CSharp/CAbstoCSharpVisitSkeleton.hs
--- a/src/BNFC/Backend/CSharp/CAbstoCSharpVisitSkeleton.hs
+++ b/src/BNFC/Backend/CSharp/CAbstoCSharpVisitSkeleton.hs
@@ -15,7 +15,7 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 {-
diff --git a/src/BNFC/Backend/CSharp/CFtoCSharpPrinter.hs b/src/BNFC/Backend/CSharp/CFtoCSharpPrinter.hs
--- a/src/BNFC/Backend/CSharp/CFtoCSharpPrinter.hs
+++ b/src/BNFC/Backend/CSharp/CFtoCSharpPrinter.hs
@@ -16,7 +16,7 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 {-
diff --git a/src/BNFC/Backend/CSharp/CFtoGPLEX.hs b/src/BNFC/Backend/CSharp/CFtoGPLEX.hs
--- a/src/BNFC/Backend/CSharp/CFtoGPLEX.hs
+++ b/src/BNFC/Backend/CSharp/CFtoGPLEX.hs
@@ -16,7 +16,7 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 {-
@@ -53,7 +53,7 @@
   "%%"
   ], env')
   where
-    env = makeSymEnv (symbols cf ++ reservedWords cf) (0 :: Int)
+    env = makeSymEnv (cfgSymbols cf ++ reservedWords cf) (0 :: Int)
     env' = env ++ (makeSymEnv (tokenNames cf) (length env))
     -- GPPG doesn't seem to like tokens beginning with an underscore, so they (the underscores, nothing else) have been removed.
     makeSymEnv [] _ = []
diff --git a/src/BNFC/Backend/CSharp/CFtoGPPG.hs b/src/BNFC/Backend/CSharp/CFtoGPPG.hs
--- a/src/BNFC/Backend/CSharp/CFtoGPPG.hs
+++ b/src/BNFC/Backend/CSharp/CFtoGPPG.hs
@@ -16,7 +16,7 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 {-
@@ -87,14 +87,14 @@
 
 definedRules :: Namespace -> CF -> String
 definedRules _ cf = unlinesInline [
-  if null [ rule f xs e | FunDef f xs e <- pragmasOfCF cf ]
+  if null [ rule f xs e | FunDef f xs e <- cfgPragmas cf ]
     then ""
     else error "Defined rules are not yet available in C# mode!"
   ]
   where
     ctx = buildContext cf
 
-    list = LC (const "[]") (\t -> "List" ++ unBase t)
+    list = LC (const "[]") (\ t -> "List" ++ unBase t)
       where
         unBase (ListT t) = unBase t
         unBase (BaseT x) = show$normCat$strToCat x
@@ -196,7 +196,7 @@
       ---- "(:)" -> identCat nt
       ---- "(:[])" -> identCat nt
       z -> z
-    revs = reversibleCats cf
+    revs = cfgReversibleCats cf
     eps = allEntryPoints cf
     isEntry nt = if elem nt eps then True else False
     result = if isEntry nt then (resultName (identCat (normCat nt))) ++ "= $$;" else ""
@@ -242,7 +242,7 @@
     -- of right-recursive lists!
     revert c = (isList c) &&
                not (isConsFun (funRule r)) && notElem c revs
-    revs = reversibleCats cf
+    revs = cfgReversibleCats cf
 
 -- We have now constructed the patterns and actions,
 -- so the only thing left is to merge them into one string.
diff --git a/src/BNFC/Backend/CSharp/CSharpUtils.hs b/src/BNFC/Backend/CSharp/CSharpUtils.hs
--- a/src/BNFC/Backend/CSharp/CSharpUtils.hs
+++ b/src/BNFC/Backend/CSharp/CSharpUtils.hs
@@ -14,7 +14,7 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 {-
@@ -148,4 +148,3 @@
      Just n -> (Left $ f' ++ (show $ n + 1)) : (numProps ((f',n+1):env) fs)
  where
    f' = propertyName (identCat (normCat f))
-
diff --git a/src/BNFC/Backend/Common.hs b/src/BNFC/Backend/Common.hs
--- a/src/BNFC/Backend/Common.hs
+++ b/src/BNFC/Backend/Common.hs
@@ -1,6 +1,11 @@
+{-# LANGUAGE NoImplicitPrelude #-}
+
+-- | Functions common to different backends.
+
 module BNFC.Backend.Common (renderListSepByPrecedence) where
--- Functions common to different backends
 
+import Prelude'
+
 import BNFC.PrettyPrint
 
 -- | Helper function for c-like languages that generates the code printing
@@ -30,4 +35,3 @@
     ++ ["default" <:> render sep <>";" | let (_,sep) = last ss])
   where
     a <:> b = a <> ":" <+> b
-
diff --git a/src/BNFC/Backend/Common/Makefile.hs b/src/BNFC/Backend/Common/Makefile.hs
--- a/src/BNFC/Backend/Common/Makefile.hs
+++ b/src/BNFC/Backend/Common/Makefile.hs
@@ -1,28 +1,52 @@
+{-# LANGUAGE NoImplicitPrelude #-}
+
 module BNFC.Backend.Common.Makefile where
 
-import Text.Printf
+import Prelude'
 
 import BNFC.Options (SharedOptions(..))
 import BNFC.Backend.Base (mkfile, Backend)
-
-type Makefile = ShowS
-
+import BNFC.PrettyPrint
 
+-- | Creates a Makefile rule
+-- >>> mkRule "main" ["file1","file2"] ["do something"]
+-- main: file1 file2
+-- 	do something
+-- <BLANKLINE>
+--
+-- >>> mkRule "main" ["program.exe"] []
+-- main: program.exe
+-- <BLANKLINE>
 mkRule :: String   -- ^ The target name
        -> [String] -- ^ Dependencies
        -> [String] -- ^ Recipe
-       -> Makefile
-mkRule target deps recipe = (++) $ unlines $
-  [ unwords (printf "%s:" target:deps) ]
-  ++ map (printf "\t%s") recipe
-  ++ [""]
+       -> Doc
+mkRule target deps recipes =
+    text target <> ":" <+> hsep (map text deps)
+    $$ vcat [ "\t" <> text recipe | recipe <- recipes ]
+    $$ ""
 
-mkVar :: String -> String -> Makefile
-mkVar n v = (++) (n ++ "=" ++ v  ++ "\n")
+-- | Variable assignment
+--
+-- >>> mkVar "FOO" "bar"
+-- FOO=bar
+mkVar :: String -> String -> Doc
+mkVar n v = text n <> "=" <> text v
 
+--- | Variable referencing
+--
+-- >>> mkRefVar "FOO"
+-- ${FOO}
+mkRefVar :: String -> Doc
+mkRefVar m  = case m of
+    "" -> ""
+    _ -> text $ refVar m
 
+refVar :: String -> String
+refVar m = "${" ++ m ++ "}"
+
 -- | Create the Makefile file using the name specified in the option
 -- record.
-mkMakefile :: SharedOptions -> String -> Backend
+mkMakefile :: SharedOptions -> Doc -> Backend
 mkMakefile Options {make = Nothing} _ = return ()
 mkMakefile Options {make = Just makefile} content = mkfile makefile content
diff --git a/src/BNFC/Backend/Common/NamedVariables.hs b/src/BNFC/Backend/Common/NamedVariables.hs
--- a/src/BNFC/Backend/Common/NamedVariables.hs
+++ b/src/BNFC/Backend/Common/NamedVariables.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE NoImplicitPrelude #-}
 
 {-
     BNF Converter: Named instance variables
@@ -15,7 +16,7 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 
@@ -67,6 +68,8 @@
 
 module BNFC.Backend.Common.NamedVariables where
 
+import Prelude'
+
 import BNFC.CF
 import Data.Char (toLower)
 import Data.List (nub)
@@ -94,15 +97,15 @@
 getVars :: [Cat] -> [IVar]
 getVars [] = []
 getVars cs = foldl addVar [] (map identCat cs)
- where
-  addVar vs c = addVar' vs 0 c
-  addVar' []  n c = [(c, n)]
-  addVar' (i@(t,x):is) n c =
-    if c == t
-      then if x == 0
-        then (t, 1) : (addVar' is 2 c)
-	else i : (addVar' is (x+1) c)
-      else i : (addVar' is n c)
+  where
+    addVar vs = addVar' vs 0
+    addVar' []  n c = [(c, n)]
+    addVar' (i@(t,x):is) n c =
+      if c == t
+          then if x == 0
+              then (t, 1) : addVar' is 2 c
+              else i : addVar' is (x+1) c
+          else i : addVar' is n c
 
 -- # Create variable names for rules rhs
 -- This is about creating variable names for the right-hand side of rules.
@@ -137,11 +140,11 @@
 -- is the same.)
 fixOnes :: Eq b => [Either String b] -> [Either String b]
 fixOnes [] = []
-fixOnes ((Right f): fs) = (Right f) : (fixOnes fs)
-fixOnes ((Left f) : fs) =
-  if elem (Left (f ++ "2")) fs
-    then (Left (f ++ "1")) : (fixOnes fs)
-    else (Left f) : (fixOnes fs)
+fixOnes (Right f : fs) = Right f : fixOnes fs
+fixOnes (Left f : fs) =
+  if Left (f ++ "2") `elem` fs
+    then Left (f ++ "1") : fixOnes fs
+    else Left f : fixOnes fs
 
 --This fixes the problem with coercions.
 fixCoercions :: [(Cat, [Rule])] -> [(Cat, [Rule])]
@@ -149,17 +152,22 @@
  where
   fixCoercion :: Cat -> [(Cat, [Rule])] -> [Rule]
   fixCoercion _ [] = []
-  fixCoercion cat ((c,rules):cats) = if (normCat c) == (normCat cat)
-    then rules ++ (fixCoercion cat cats)
+  fixCoercion cat ((c,rules):cats) = if normCat c == normCat cat
+    then rules ++ fixCoercion cat cats
     else fixCoercion cat cats
   fixAll :: [(Cat, [Rule])] -> [(Cat, [Rule])] -> [(Cat, [Rule])]
   fixAll _ [] = []
   fixAll top ((cat,_):cats) = if isCoercion (show cat) -- This is weird: isCoercion is supposed to be applied to functions!!!!
     then fixAll top cats
-    else (normCat cat, fixCoercion cat top) : (fixAll top cats)
+    else (normCat cat, fixCoercion cat top) : fixAll top cats
 
 --A generic variable name for C-like languages.
-varName c = (map toLower c) ++ "_"
+varName c = map toLower c ++ "_"
 
 --this makes var names a little cleaner.
-showNum n = if n == 0 then [] else (show n)
+showNum n = if n == 0 then [] else show n
+
+-- Makes the first letter a lowercase.
+firstLowerCase :: String -> String
+firstLowerCase "" = ""
+firstLowerCase (a:b) = toLower a:b
diff --git a/src/BNFC/Backend/Common/OOAbstract.hs b/src/BNFC/Backend/Common/OOAbstract.hs
--- a/src/BNFC/Backend/Common/OOAbstract.hs
+++ b/src/BNFC/Backend/Common/OOAbstract.hs
@@ -14,7 +14,7 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 {-
@@ -76,7 +76,7 @@
   listtypes  = [(c, snd (status (drop 4 c))) | -- remove "List" from "ListC"
                   c <- map (identCat . normCat) lists],
   absclasses = nub $ map (show.normCat) cats,
-  conclasses = [f | Just f <- map testRule (rulesOfCF cf)],
+  conclasses = [f | Just f <- map testRule (cfgRules cf)],
   signatures = posdata ++ map normSig (cf2data cf),
   postokens  = map show pos,
   defineds   = defs
@@ -95,7 +95,7 @@
     [("Visitable",  -- to give superclass
      [(show c,[("String",False,"string_"),("Integer",False,"integer_")])]) | c<-pos]
   status cat = (cat, notElem cat (map fst basetypes ++ toks))
-  defs = [f | FunDef f _ _ <- pragmasOfCF cf]
+  defs = [f | FunDef f _ _ <- cfgPragmas cf]
 
   classVars :: [(String,Bool)] -> [(String,Bool,String)]
   classVars cs =
@@ -116,9 +116,6 @@
   ("String", "std::string"),
   ("Ident",  "std::string")
   ]
-
-isBaseType :: CAbs -> String -> Bool
-isBaseType cf c = elem c $ tokentypes cf ++ map fst basetypes
 
 classVar :: String -> String
 classVar c = map toLower c ++ "_"
diff --git a/src/BNFC/Backend/Haskell.hs b/src/BNFC/Backend/Haskell.hs
--- a/src/BNFC/Backend/Haskell.hs
+++ b/src/BNFC/Backend/Haskell.hs
@@ -14,7 +14,7 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 module BNFC.Backend.Haskell (makeHaskell, AlexVersion(..), makefile, testfile) where
@@ -73,7 +73,7 @@
       Alex3 -> do
         mkfile (alexFile opts) $ cf2alex3 lexMod errMod shareMod (shareStrings opts) (byteStrings opts) cf
         liftIO $ printf "Use Alex 3.0 to compile %s.\n" (alexFile opts)
-    unless (cnf opts) $ do        
+    unless (cnf opts) $ do
       mkfile (happyFile opts) $
         cf2HappyS parMod absMod lexMod errMod (glr opts) (byteStrings opts) (functor opts) cf
       liftIO $ printf "%s Tested with Happy 1.15\n" (happyFile opts)
@@ -82,7 +82,7 @@
     mkfile (templateFile opts) $ cf2Template (templateFileM opts) absMod errMod (functor opts) cf
     mkfile (printerFile opts)  $ cf2Printer (byteStrings opts) (functor opts) False prMod absMod cf
     when (hasLayout cf) $ mkfile (layoutFile opts) $ cf2Layout (alex1 opts) (inDir opts) layMod lexMod cf
-    mkfile (errFile opts)      $ errM errMod cf
+    mkfile (errFile opts) $ mkErrM errMod (ghcExtensions opts)
     when (shareStrings opts) $ mkfile (shareFile opts)    $ sharedString shareMod (byteStrings opts) cf
     Makefile.mkMakefile opts $ makefile opts
     case xml opts of
@@ -95,38 +95,39 @@
       mkfile "BenchCNF.hs" $ ToCNF.genBenchmark opts
 
 
-makefile :: Options -> String
+makefile :: Options -> Doc
 makefile opts = makeA where
   glr_params = if glr opts == GLR then "--glr --decode " else ""
   dir = let d = codeDir opts in if null d then "" else d ++ [pathSeparator]
-  makeA = Makefile.mkRule "all" []
+  makeA = vcat
+      [ Makefile.mkRule "all" []
            ([ "happy -gca " ++ glr_params ++ happyFile opts | not (cnf opts) ] ++
             [ "alex -g " ++ alexFile opts ] ++
-            [ if cnf opts 
+            [ if cnf opts
               then "ghc --make TestCNF.hs"
               else "ghc --make " ++ tFile opts ++ " -o " ++ mkFile withLang "Test" "" opts])
-        $ Makefile.mkRule "clean" []
-            [ "-rm -f "  ++ unwords
+      , Makefile.mkRule "clean" []
+          [ "-rm -f "  ++ unwords
                 (map (dir++) [ "*.log", "*.aux", "*.hi", "*.o", "*.dvi" ]) ]
-        $  Makefile.mkRule "distclean" ["clean"]
-            [ "-rm -f " ++ unwords
-                [ mkFile withLang "Doc" "*" opts
-                , mkFile withLang "Lex" "*" opts
-                , mkFile withLang "Par" "*" opts
-                , mkFile withLang "Layout" "*" opts
-                , mkFile withLang "Skel" "*" opts
-                , mkFile withLang "Print" "*" opts
-                , mkFile withLang "Test" "*" opts
-                , mkFile withLang "Abs" "*" opts
-                , mkFile withLang "Test" "" opts
-                , mkFile noLang   "ErrM" "*" opts
-                , mkFile noLang   "SharedString" "*" opts
-                , mkFile noLang "ComposOp" "*" opts
-                , dir ++ lang opts ++ ".dtd"
-                , mkFile withLang "XML" "*" opts
-                , "Makefile*" ]
-            , if null dir then "" else "\t-rmdir -p " ++ dir ]
-        ""
+      ,  Makefile.mkRule "distclean" ["clean"]
+          [ "-rm -f " ++ unwords
+              [ mkFile withLang "Doc" "*" opts
+              , mkFile withLang "Lex" "*" opts
+              , mkFile withLang "Par" "*" opts
+              , mkFile withLang "Layout" "*" opts
+              , mkFile withLang "Skel" "*" opts
+              , mkFile withLang "Print" "*" opts
+              , mkFile withLang "Test" "*" opts
+              , mkFile withLang "Abs" "*" opts
+              , mkFile withLang "Test" "" opts
+              , mkFile noLang   "ErrM" "*" opts
+              , mkFile noLang   "SharedString" "*" opts
+              , mkFile noLang "ComposOp" "*" opts
+              , dir ++ lang opts ++ ".dtd"
+              , mkFile withLang "XML" "*" opts
+              , "Makefile*" ]
+          , if null dir then "" else "\t-rmdir -p " ++ dir ]
+      ]
 
 testfile :: Options -> CF -> String
 testfile opts cf
@@ -144,6 +145,7 @@
                  "import System.IO ( stdin, hGetContents )",
                  "import System.Environment ( getArgs, getProgName )",
                  "import System.Exit ( exitFailure, exitSuccess )",
+                 "import Control.Monad (when)",
                  "",
                  "import " ++ alexFileM     opts,
                  "import " ++ happyFileM    opts,
@@ -166,7 +168,7 @@
                  "type Verbosity = Int",
                  "",
                  "putStrV :: Verbosity -> String -> IO ()",
-                 "putStrV v s = if v > 1 then putStrLn s else return ()",
+                 "putStrV v s = when (v > 1) $ putStrLn s",
                  "",
                  "runFile :: (" ++ xpr ++ if_glr "TreeDecode a, " ++ "Print a, Show a) => Verbosity -> ParseFun a -> FilePath -> IO ()",
                  "runFile v p f = putStrLn f >> readFile f >>= run v p",
@@ -192,11 +194,11 @@
                  "  exitFailure",
                  "",
                  "main :: IO ()",
-                 "main = do", 
+                 "main = do",
                  "  args <- getArgs",
                  "  case args of",
                  "    [\"--help\"] -> usage",
-                 "    [] -> hGetContents stdin >>= run 2 " ++ firstParser,
+                 "    [] -> getContents >>= run 2 " ++ firstParser,
                  "    \"-s\":fs -> mapM_ (runFile 0 " ++ firstParser ++ ") fs",
                  "    fs -> mapM_ (runFile 2 " ++ firstParser ++ ") fs",
                  "",
@@ -276,4 +278,3 @@
    , "                            dec_fn f = decode (find f) r"
    , "                        in GLR_Result (\\ff -> dec_fn $ ff f) (dec_fn f)"
    ]
-
diff --git a/src/BNFC/Backend/Haskell/CFtoAbstract.hs b/src/BNFC/Backend/Haskell/CFtoAbstract.hs
--- a/src/BNFC/Backend/Haskell/CFtoAbstract.hs
+++ b/src/BNFC/Backend/Haskell/CFtoAbstract.hs
@@ -1,3 +1,5 @@
+{-# LANGUAGE NoImplicitPrelude #-}
+
 {-
     BNF Converter: Abstract syntax Generator
     Copyright (C) 2004  Author:  Markus Forberg
@@ -14,10 +16,12 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 module BNFC.Backend.Haskell.CFtoAbstract (cf2Abstract) where
+
+import Prelude'
 
 import BNFC.CF
 import BNFC.Utils((+++))
diff --git a/src/BNFC/Backend/Haskell/CFtoAlex.hs b/src/BNFC/Backend/Haskell/CFtoAlex.hs
--- a/src/BNFC/Backend/Haskell/CFtoAlex.hs
+++ b/src/BNFC/Backend/Haskell/CFtoAlex.hs
@@ -14,7 +14,7 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 
@@ -74,7 +74,7 @@
 
 rMacros :: CF -> [String]
 rMacros cf =
-  let symbs = symbols cf
+  let symbs = cfgSymbols cf
   in
   (if null symbs then [] else [
    "{ %s =    -- reserved words consisting of special symbols",
@@ -91,7 +91,7 @@
   "\"tokens_lx\"/\"tokens_acts\":-",
   lexComments (comments cf),
   "<>         ::= ^w+",
-  pTSpec (symbols cf,[]), -- modif Markus 12/02 - 2002
+  pTSpec (cfgSymbols cf,[]), -- modif Markus 12/02 - 2002
 
   userDefTokenTypes,
   identAndRes,
diff --git a/src/BNFC/Backend/Haskell/CFtoAlex2.hs b/src/BNFC/Backend/Haskell/CFtoAlex2.hs
--- a/src/BNFC/Backend/Haskell/CFtoAlex2.hs
+++ b/src/BNFC/Backend/Haskell/CFtoAlex2.hs
@@ -14,7 +14,7 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 -------------------------------------------------------------------
@@ -75,7 +75,7 @@
 
 rMacros :: CF -> [String]
 rMacros cf =
-  let symbs = symbols cf
+  let symbs = cfgSymbols cf
   in
   (if null symbs then [] else [
    "@rsyms =    -- symbols and non-identifier-like reserved words",
@@ -96,7 +96,7 @@
   ":-",
   lexComments (comments cf),
   "$white+ ;",
-  pTSpec (symbols cf),
+  pTSpec (cfgSymbols cf),
 
   userDefTokenTypes,
   ident,
@@ -251,7 +251,7 @@
      "$l $i*   { tok (\\p s -> PT p (eitherResIdent (TV . share) s)) }"
      --ifC "Ident"  "<ident>   ::= ^l ^i*   { ident  p = PT p . eitherResIdent TV }"
 
-   resws = reservedWords cf ++ symbols cf
+   resws = reservedWords cf ++ cfgSymbols cf
 
 
 data BTree = N | B String Int BTree BTree
diff --git a/src/BNFC/Backend/Haskell/CFtoAlex3.hs b/src/BNFC/Backend/Haskell/CFtoAlex3.hs
--- a/src/BNFC/Backend/Haskell/CFtoAlex3.hs
+++ b/src/BNFC/Backend/Haskell/CFtoAlex3.hs
@@ -16,7 +16,7 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 module BNFC.Backend.Haskell.CFtoAlex3 (cf2alex3) where
@@ -68,7 +68,7 @@
 
 rMacros :: CF -> [String]
 rMacros cf =
-  let symbs = symbols cf
+  let symbs = cfgSymbols cf
   in
   (if null symbs then [] else [
    "@rsyms =    -- symbols and non-identifier-like reserved words",
@@ -89,7 +89,7 @@
   ":-",
   lexComments (comments cf),
   "$white+ ;",
-  pTSpec (symbols cf),
+  pTSpec (cfgSymbols cf),
 
   userDefTokenTypes,
   ident,
@@ -123,10 +123,12 @@
   " | Err Posn",
   "  deriving (Eq,Show,Ord)",
   "",
+  "printPosn :: Posn -> String",
+  "printPosn (Pn _ l c) = \"line \" ++ show l ++ \", column \" ++ show c",
+  "",
   "tokenPos :: [Token] -> String",
-  "tokenPos (PT (Pn _ l _) _ :_) = \"line \" ++ show l",
-  "tokenPos (Err (Pn _ l _) :_) = \"line \" ++ show l",
-  "tokenPos _ = \"end of file\"",
+  "tokenPos (t:_) = printPosn (tokenPosn t)",
+  "tokenPos [] = \"end of file\"",
   "",
   "tokenPosn :: Token -> Posn",
   "tokenPosn (PT p _) = p",
@@ -149,6 +151,7 @@
   "  PT _ (TV s)   -> s",
   "  PT _ (TD s)   -> s",
   "  PT _ (TC s)   -> s",
+  "  Err _         -> \"#error\"",
   userDefTokenPrint,
   "",
   "data BTree = N | B "++stringType++" Tok BTree BTree deriving (Show)",
diff --git a/src/BNFC/Backend/Haskell/CFtoHappy.hs b/src/BNFC/Backend/Haskell/CFtoHappy.hs
--- a/src/BNFC/Backend/Haskell/CFtoHappy.hs
+++ b/src/BNFC/Backend/Haskell/CFtoHappy.hs
@@ -14,7 +14,7 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 module BNFC.Backend.Haskell.CFtoHappy (cf2HappyS, convert) where
@@ -123,7 +123,7 @@
 rulesForHappy absM functor cf = map mkOne $ ruleGroups cf
   where
     mkOne (cat,rules) = (cat, map (constructRule absM functor reversibles) rules)
-    reversibles = reversibleCats cf
+    reversibles = cfgReversibleCats cf
 
 -- | For every non-terminal, we construct a set of rules. A rule is a sequence
 -- of terminals and non-terminals, and an action to be performed
@@ -242,7 +242,7 @@
      "  case ts of",
      "    [] -> []",
      "    [Err _] -> \" due to lexer error\"",
-     "    _ -> \" before \" ++ unwords (map ("++stringUnpack++" . prToken) (take 4 ts))",
+     "    t:_ -> \" before `\" ++ " ++ stringUnpack ++ "(prToken t) ++ \"'\"",
      "",
      "myLexer = tokens"
    ] ++ definedRules cf ++ [ "}" ]
@@ -252,7 +252,7 @@
        | otherwise   = "id"
 
 
-definedRules cf = [ mkDef f xs e | FunDef f xs e <- pragmasOfCF cf ]
+definedRules cf = [ mkDef f xs e | FunDef f xs e <- cfgPragmas cf ]
     where
         mkDef f xs e = unwords $ (f ++ "_") : xs' ++ ["=", show e']
             where
@@ -299,4 +299,3 @@
    stringUnpack
      | byteStrings = "BS.unpack"
      | otherwise   = ""
-
diff --git a/src/BNFC/Backend/Haskell/CFtoLayout.hs b/src/BNFC/Backend/Haskell/CFtoLayout.hs
--- a/src/BNFC/Backend/Haskell/CFtoLayout.hs
+++ b/src/BNFC/Backend/Haskell/CFtoLayout.hs
@@ -15,7 +15,7 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 module BNFC.Backend.Haskell.CFtoLayout where
@@ -286,4 +286,4 @@
   ""
   ]
   where
-   resws = sort (reservedWords cf ++ symbols cf)
+   resws = sort (reservedWords cf ++ cfgSymbols cf)
diff --git a/src/BNFC/Backend/Haskell/CFtoPrinter.hs b/src/BNFC/Backend/Haskell/CFtoPrinter.hs
--- a/src/BNFC/Backend/Haskell/CFtoPrinter.hs
+++ b/src/BNFC/Backend/Haskell/CFtoPrinter.hs
@@ -1,3 +1,5 @@
+{-# LANGUAGE NoImplicitPrelude #-}
+
 {-
     BNF Converter: Pretty-printer generator
     Copyright (C) 2004  Author:  Aarne Ranta
@@ -14,183 +16,248 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 module BNFC.Backend.Haskell.CFtoPrinter (cf2Printer, compareRules) where
 
+import Prelude'
+
 import BNFC.Backend.Haskell.Utils (hsReservedWords)
 import BNFC.CF
 import BNFC.Utils
-import Data.Char(toLower)
+
+import Data.Char   (toLower)
 import Data.Either (lefts)
-import Data.List (sortBy)
-import Data.Maybe (fromJust)
+import Data.List   (sortBy, intersperse)
+
+-- import Debug.Trace (trace)
 import Text.PrettyPrint
 
--- derive pretty-printer from a BNF grammar. AR 15/2/2002
-cf2Printer :: Bool -> Bool -> Bool -> String -> String -> CF -> String
-cf2Printer byteStrings functor useGadt name absMod cf = unlines [
-  prologue byteStrings useGadt name absMod,
-  integerRule cf,
-  doubleRule cf,
-  if hasIdent cf then identRule byteStrings cf else "",
-  unlines [ownPrintRule byteStrings cf own | (own,_) <- tokenPragmas cf],
-  rules functor cf
+-- AR 15/2/2002
+
+-- | Derive pretty-printer from a BNF grammar.
+cf2Printer
+  :: Bool    -- ^ Are identifiers @ByteString@s rather than @String@s?  (Option @--bytestrings@)
+  -> Bool    -- ^ Option @--functor@?
+  -> Bool    -- ^ @--haskell-gadt@?
+  -> String  -- ^ Name of created Haskell module.
+  -> String  -- ^ Name of Haskell module for abstract syntax.
+  -> CF      -- ^ Grammar.
+  -> String
+cf2Printer byteStrings functor useGadt name absMod cf = unlines $ concat $
+  -- Each of the following list entries is itself a list of lines
+  [ prologue byteStrings useGadt name absMod
+  , integerRule cf
+  , doubleRule cf
+  , if hasIdent cf then identRule byteStrings cf else []
+  ] ++ [ ownPrintRule byteStrings cf own | (own,_) <- tokenPragmas cf ] ++
+  [ rules functor cf
   ]
 
 
-prologue :: Bool -> Bool -> String -> String -> String
-prologue byteStrings useGadt name absMod = unlines $
-  ["{-# LANGUAGE GADTs, TypeSynonymInstances, FlexibleInstances #-}" | useGadt]
-  ++ [
-  "{-# OPTIONS_GHC -fno-warn-incomplete-patterns #-}",
-  "module " ++ name +++ "where\n",
-  "-- pretty-printer generated by the BNF converter\n",
-  "import " ++ absMod,
-  "import Data.Char",
-  (if byteStrings then "import qualified Data.ByteString.Char8 as BS" else ""),
-  "",
-  "-- the top-level printing method",
-  "printTree :: Print a => a -> String",
-  "printTree = render . prt 0",
-  "",
-  "type Doc = [ShowS] -> [ShowS]",
-  "",
-  "doc :: ShowS -> Doc",
-  "doc = (:)",
-  "",
-  "render :: Doc -> String",
-  "render d = rend 0 (map ($ \"\") $ d []) \"\" where",
-  "  rend i ss = case ss of",
-  "    \"[\"      :ts -> showChar '[' . rend i ts",
-  "    \"(\"      :ts -> showChar '(' . rend i ts",
-  "    \"{\"      :ts -> showChar '{' . new (i+1) . rend (i+1) ts",
-  "    \"}\" : \";\":ts -> new (i-1) . space \"}\" . showChar ';' . new (i-1) . rend (i-1) ts",
-  "    \"}\"      :ts -> new (i-1) . showChar '}' . new (i-1) . rend (i-1) ts",
-  "    \";\"      :ts -> showChar ';' . new i . rend i ts",
-  "    t  : \",\" :ts -> showString t . space \",\" . rend i ts",
-  "    t  : \")\" :ts -> showString t . showChar ')' . rend i ts",
-  "    t  : \"]\" :ts -> showString t . showChar ']' . rend i ts",
-  "    t        :ts -> space t . rend i ts",
-  "    _            -> id",
-  "  new i   = showChar '\\n' . replicateS (2*i) (showChar ' ') . dropWhile isSpace",
-  "  space t = showString t . (\\s -> if null s then \"\" else (' ':s))",
-  "",
-  "parenth :: Doc -> Doc",
-  "parenth ss = doc (showChar '(') . ss . doc (showChar ')')",
-  "",
-  "concatS :: [ShowS] -> ShowS",
-  "concatS = foldr (.) id",
-  "",
-  "concatD :: [Doc] -> Doc",
-  "concatD = foldr (.) id",
-  "",
-  "replicateS :: Int -> ShowS -> ShowS",
-  "replicateS n f = concatS (replicate n f)",
-  "",
-  "-- the printer class does the job",
-  "class Print a where",
-  "  prt :: Int -> a -> Doc",
-  "  prtList :: Int -> [a] -> Doc",
-  "  prtList i = concatD . map (prt i)",
-  "",
-  "instance Print a => Print [a] where",
-  "  prt = prtList",
-  "",
-  "instance Print Char where",
-  "  prt _ s = doc (showChar '\\'' . mkEsc '\\'' s . showChar '\\'')",
-  "  prtList _ s = doc (showChar '\"' . concatS (map (mkEsc '\"') s) . showChar '\"')",
-  "",
-  "mkEsc :: Char -> Char -> ShowS",
-  "mkEsc q s = case s of",
-  "  _ | s == q -> showChar '\\\\' . showChar s",
-  "  '\\\\'-> showString \"\\\\\\\\\"",
-  "  '\\n' -> showString \"\\\\n\"",
-  "  '\\t' -> showString \"\\\\t\"",
-  "  _ -> showChar s",
-  "",
-  "prPrec :: Int -> Int -> Doc -> Doc",
-  "prPrec i j = if j<i then parenth else id",
-  ""
+prologue :: Bool -> Bool -> String -> String -> [String]
+prologue byteStrings useGadt name absMod =
+  [ "{-# LANGUAGE GADTs, TypeSynonymInstances #-}" | useGadt ] ++
+  [ "{-# LANGUAGE FlexibleInstances, OverlappingInstances #-}"
+  , "{-# OPTIONS_GHC -fno-warn-incomplete-patterns #-}"
+  , ""
+  , "-- | Pretty-printer for " ++ takeWhile ('.' /=) name ++ "."
+  , "--   Generated by the BNF converter."
+  , ""
+  , "module " ++ name +++ "where"
+  , ""
+  , "import " ++ absMod
+  , "import Data.Char"
+  ] ++ [ "import qualified Data.ByteString.Char8 as BS" | byteStrings ] ++
+  [ ""
+  , "-- | The top-level printing method."
+  , ""
+  , "printTree :: Print a => a -> String"
+  , "printTree = render . prt 0"
+  , ""
+  , "type Doc = [ShowS] -> [ShowS]"
+  , ""
+  , "doc :: ShowS -> Doc"
+  , "doc = (:)"
+  , ""
+  , "render :: Doc -> String"
+  , "render d = rend 0 (map ($ \"\") $ d []) \"\" where"
+  , "  rend i ss = case ss of"
+  , "    \"[\"      :ts -> showChar '[' . rend i ts"
+  , "    \"(\"      :ts -> showChar '(' . rend i ts"
+  , "    \"{\"      :ts -> showChar '{' . new (i+1) . rend (i+1) ts"
+  , "    \"}\" : \";\":ts -> new (i-1) . space \"}\" . showChar ';' . new (i-1) . rend (i-1) ts"
+  , "    \"}\"      :ts -> new (i-1) . showChar '}' . new (i-1) . rend (i-1) ts"
+  , "    \";\"      :ts -> showChar ';' . new i . rend i ts"
+  , "    t  : ts@(p:_) | closingOrPunctuation p -> showString t . rend i ts"
+  , "    t        :ts -> space t . rend i ts"
+  , "    _            -> id"
+  , "  new i   = showChar '\\n' . replicateS (2*i) (showChar ' ') . dropWhile isSpace"
+  , "  space t = showString t . (\\s -> if null s then \"\" else ' ':s)"
+  , ""
+  , "  closingOrPunctuation :: String -> Bool"
+  , "  closingOrPunctuation [c] = c `elem` closerOrPunct"
+  , "  closingOrPunctuation _   = False"
+  , ""
+  , "  closerOrPunct :: String"
+  , "  closerOrPunct = \")],;\""
+  , ""
+  , "parenth :: Doc -> Doc"
+  , "parenth ss = doc (showChar '(') . ss . doc (showChar ')')"
+  , ""
+  , "concatS :: [ShowS] -> ShowS"
+  , "concatS = foldr (.) id"
+  , ""
+  , "concatD :: [Doc] -> Doc"
+  , "concatD = foldr (.) id"
+  , ""
+  , "replicateS :: Int -> ShowS -> ShowS"
+  , "replicateS n f = concatS (replicate n f)"
+  , ""
+  , "-- | The printer class does the job."
+  , ""
+  , "class Print a where"
+  , "  prt :: Int -> a -> Doc"
+  , "  prtList :: Int -> [a] -> Doc"
+  , "  prtList i = concatD . map (prt i)"
+  , ""
+  , "instance Print a => Print [a] where"
+  , "  prt = prtList"
+  , ""
+  , "instance Print Char where"
+  , "  prt _ s = doc (showChar '\\'' . mkEsc '\\'' s . showChar '\\'')"
+  , "  prtList _ s = doc (showChar '\"' . concatS (map (mkEsc '\"') s) . showChar '\"')"
+  , ""
+  , "mkEsc :: Char -> Char -> ShowS"
+  , "mkEsc q s = case s of"
+  , "  _ | s == q -> showChar '\\\\' . showChar s"
+  , "  '\\\\'-> showString \"\\\\\\\\\""
+  , "  '\\n' -> showString \"\\\\n\""
+  , "  '\\t' -> showString \"\\\\t\""
+  , "  _ -> showChar s"
+  , ""
+  , "prPrec :: Int -> Int -> Doc -> Doc"
+  , "prPrec i j = if j < i then parenth else id"
+  , ""
   ]
 
-integerRule cf = showsPrintRule cf "Integer"
-doubleRule cf = showsPrintRule cf "Double"
+-- | Printing instance for @Integer@, and possibly @[Integer]@.
+integerRule :: CF -> [String]
+integerRule cf = showsPrintRule cf $ TokenCat "Integer"
 
-showsPrintRule cf t = unlines $ [
-  "instance Print " ++ t ++ " where",
-  "  prt _ x = doc (shows x)",
-  ifList cf (Cat t)
+-- | Printing instance for @Double@, and possibly @[Double]@.
+doubleRule :: CF -> [String]
+doubleRule cf = showsPrintRule cf $ TokenCat "Double"
+
+showsPrintRule :: CF -> Cat -> [String]
+showsPrintRule cf t =
+  [ "instance Print " ++ show t ++ " where"
+  , "  prt _ x = doc (shows x)"
+  ] ++ ifList cf t ++
+  [ ""
   ]
 
+-- | Printing instance for @Ident@, and possibly @[Ident]@.
+identRule :: Bool -> CF -> [String]
 identRule byteStrings cf = ownPrintRule byteStrings cf catIdent
 
-ownPrintRule byteStrings cf own = unlines $ [
-  "instance Print " ++ show own ++ " where",
-  "  prt _ (" ++ show own ++ posn ++ ") = doc (showString ("++stringUnpack++" i))",
-  ifList cf own
+-- | Printing identifiers and terminals.
+ownPrintRule :: Bool -> CF -> Cat -> [String]
+ownPrintRule byteStrings cf own =
+  [ "instance Print " ++ show own ++ " where"
+  , "  prt _ (" ++ show own ++ posn ++ ") = doc (showString " ++ stringUnpack ++ ")"
+  ] ++ ifList cf own ++
+  [ ""
   ]
  where
    posn = if isPositionCat cf own then " (_,i)" else " i"
 
-   stringUnpack | byteStrings = "BS.unpack"
-                | otherwise   = ""
-
--- copy and paste from BNFC.Backend.Haskell.CFtoTemplate
-
-rules :: Bool -> CF -> String
-rules functor cf = unlines $
-
-  map (\(s,xs) -> render (case_fun functor s (map toArgs xs)) ++++ ifList cf s) $ cf2data cf
- where
-   toArgs (cons,_) = (cons, ruleOf cons)
-   ruleOf s = fromJust $ lookupRule s (rulesOfCF cf)
+   stringUnpack | byteStrings = "(BS.unpack i)"
+                | otherwise   = "i"
 
+-- | Printing rules for the AST nodes.
+rules :: Bool -> CF -> [String]
+rules functor cf = do
+    (cat, xs :: [(Fun, [Cat])]) <- cf2dataLists cf
+    [ render (case_fun functor cat (map (toArgs cat) xs)) ] ++ ifList cf cat ++ [ "" ]
+  where
+    toArgs :: Cat -> (Fun, [Cat]) -> Rule
+    toArgs cat (cons, _) =
+      case filter (\ (Rule f c _rhs) -> cons == f && cat == normCat c) (cfgRules cf)
+      of
+        (r : _) -> r
+        -- 2018-01-14:  Currently, there can be overlapping rules like
+        --   Foo. Bar ::= "foo" ;
+        --   Foo. Bar ::= "bar" ;
+        -- Of course, this will generate an arbitary printer for @Foo@.
+        [] -> error $ "CFToPrinter.rules: no rhs found for: " ++ cons ++ ". " ++ show cat ++ " ::= ?"
 -- |
--- >>> case_fun False (Cat "A") [("AA", (Cat "AB", [Right "xxx"]))]
+-- >>> case_fun False (Cat "A") [ (Rule "AA" (Cat "AB") [Right "xxx"]) ]
 -- instance Print A where
 --   prt i e = case e of
 --     AA -> prPrec i 0 (concatD [doc (showString "xxx")])
-case_fun :: Bool -> Cat -> [(String, (Cat, [Either Cat String]))] -> Doc
-case_fun functor cat xs = vcat
+case_fun :: Bool -> Cat -> [Rule] -> Doc
+case_fun functor cat xs =
+  -- trace ("case_fun: cat = " ++ show cat) $
+  -- trace ("case_fun: xs  = " ++ show xs ) $
+  vcat
     [ "instance Print" <+> type_ <+> "where"
-    , nest 2 $ vcat
+    , nest 2 $ if isList cat then "prt = prtList" else vcat
         [ "prt i e = case e of"
         , nest 2 $ vcat (map (mkPrintCase functor) xs)
         ]
     ]
   where
-    type_ | functor   = parens (text (show cat) <+> "a")
-          | otherwise = text (show cat)
+    type_
+     | functor   = case cat of
+         ListCat{}  -> type' cat
+         _ -> parens $ type' cat
+     | otherwise = text (show cat)
+    type' = \case
+      ListCat c    -> "[" <> type' c <> "]"
+      c@TokenCat{} -> text (show c)
+      c            -> text (show c) <+> "a"
 
---  When writing the Print instance for a category (in case_fun), we have
+-- | When writing the Print instance for a category (in case_fun), we have
 -- a different case for each constructor for this category.
--- >>> mkPrintCase False ("AA", (Cat "A", [Right "xxx"]))
+--
+-- >>> mkPrintCase False (Rule "AA" (Cat "A") [Right "xxx"])
 -- AA -> prPrec i 0 (concatD [doc (showString "xxx")])
 --
--- Coercion levels are passed to prPrec
--- >>> mkPrintCase False ("EInt", (CoercCat "Expr" 2, [Left (TokenCat "Integer")]))
+-- Coercion levels are passed to @prPrec@.
+--
+-- >>> mkPrintCase False (Rule "EInt" (CoercCat "Expr" 2) [Left (TokenCat "Integer")])
 -- EInt n -> prPrec i 2 (concatD [prt 0 n])
--- >>> mkPrintCase False ("EPlus", (CoercCat "Expr" 1, [Left (Cat "Expr"), Right "+", Left (Cat "Expr")]))
--- EPlus expr0 expr -> prPrec i 1 (concatD [prt 0 expr0, doc (showString "+"), prt 0 expr])
 --
--- If the AST is a functor, ignore first argument
--- >>> mkPrintCase True ("EInt", (CoercCat "Expr" 2, [Left (TokenCat "Integer")]))
+-- >>> mkPrintCase False (Rule "EPlus" (CoercCat "Expr" 1) [Left (Cat "Expr"), Right "+", Left (Cat "Expr")])
+-- EPlus expr1 expr2 -> prPrec i 1 (concatD [prt 0 expr1, doc (showString "+"), prt 0 expr2])
+--
+-- If the AST is a functor, ignore first argument.
+--
+-- >>> mkPrintCase True (Rule "EInt" (CoercCat "Expr" 2) [Left (TokenCat "Integer")])
 -- EInt _ n -> prPrec i 2 (concatD [prt 0 n])
 --
--- Skip intertal categories
--- >>> mkPrintCase True ("EInternal", (Cat "Expr", [Left InternalCat, Left (Cat "Expr")]))
+-- Skip internal categories.
+--
+-- >>> mkPrintCase True (Rule "EInternal" (Cat "Expr") [Left InternalCat, Left (Cat "Expr")])
 -- EInternal _ expr -> prPrec i 0 (concatD [prt 0 expr])
-mkPrintCase :: Bool -> (Fun, (Cat, [Either Cat String])) -> Doc
-mkPrintCase functor (f, (cat, rhs)) =
-    text f <+> (if functor then "_" else empty) <+> hsep variables <+> "->"
-    <+> "prPrec i" <+> integer (precCat cat) <+> mkRhs (map render variables) rhs
+--
+mkPrintCase :: Bool -> Rule -> Doc
+mkPrintCase functor (Rule f cat rhs) =
+    pattern <+> "->"
+    <+> "prPrec i" <+> integer (precCat cat) <+> parens (mkRhs (map render variables) rhs)
   where
+    pattern :: Doc
+    pattern
+      | isOneFun  f = text "[" <+> head variables <+> "]"
+      | isConsFun f = hsep $ intersperse (text ":") variables
+      | otherwise   = text f <+> (if functor then "_" else empty) <+> hsep variables
     -- Creating variables names used in pattern matching. In addition to
     -- haskell's reserved words, `e` and `i` are used in the printing function
     -- and should be avoided
     names = map var (filter (/=InternalCat) $ lefts rhs)
+    variables :: [Doc]
     variables = map text $ mkNames ("e":"i":hsReservedWords) LowerCase names
     var (ListCat c)  = var c ++ "s"
     var (TokenCat "Ident")   = "id"
@@ -198,27 +265,40 @@
     var (TokenCat "String")  = "str"
     var (TokenCat "Char")    = "c"
     var (TokenCat "Double")  = "d"
-    var xs        = map toLower $ show xs
+    var xs = map toLower $ show xs
 
-ifList :: CF -> Cat -> String
-ifList cf cat = render $ nest 2 $ vcat [ mkPrtListCase r | r <- rules ]
+ifList :: CF -> Cat -> [String]
+ifList cf cat =
+    -- trace ("ifList cf    = " ++ show cf   ) $
+    -- trace ("ifList cat   = " ++ show cat  ) $
+    -- trace ("ifList rules = " ++ show rules) $
+    -- trace ("ifList rulesForCat cf (ListCat cat) = " ++ show (rulesForCat cf (ListCat cat))) $
+    -- trace "" $
+    map (render . nest 2) cases
   where
     rules = sortBy compareRules $ rulesForNormalizedCat cf (ListCat cat)
-
+    cases = [ mkPrtListCase r | r <- rules ]
 
 -- | Pattern match on the list constructor and the coercion level
+--
 -- >>> mkPrtListCase (Rule "[]" (ListCat (Cat "Foo")) [])
--- prtList _ [] = (concatD [])
+-- prtList _ [] = concatD []
+--
 -- >>> mkPrtListCase (Rule "(:[])" (ListCat (Cat "Foo")) [Left (Cat "FOO")])
--- prtList _ [x] = (concatD [prt 0 x])
+-- prtList _ [x] = concatD [prt 0 x]
+--
 -- >>> mkPrtListCase (Rule "(:)" (ListCat (Cat "Foo")) [Left (Cat "Foo"), Left (ListCat (Cat "Foo"))])
--- prtList _ (x:xs) = (concatD [prt 0 x, prt 0 xs])
+-- prtList _ (x:xs) = concatD [prt 0 x, prt 0 xs]
+--
 -- >>> mkPrtListCase (Rule "[]" (ListCat (CoercCat "Foo" 2)) [])
--- prtList 2 [] = (concatD [])
+-- prtList 2 [] = concatD []
+--
 -- >>> mkPrtListCase (Rule "(:[])" (ListCat (CoercCat "Foo" 2)) [Left (CoercCat "Foo" 2)])
--- prtList 2 [x] = (concatD [prt 2 x])
+-- prtList 2 [x] = concatD [prt 2 x]
+--
 -- >>> mkPrtListCase (Rule "(:)" (ListCat (CoercCat "Foo" 2)) [Left (CoercCat "Foo" 2), Left (ListCat (CoercCat "Foo" 2))])
--- prtList 2 (x:xs) = (concatD [prt 2 x, prt 2 xs])
+-- prtList 2 (x:xs) = concatD [prt 2 x, prt 2 xs]
+--
 mkPrtListCase :: Rule -> Doc
 mkPrtListCase (Rule f (ListCat c) rhs)
   | isNilFun f = "prtList" <+> precPattern <+> "[]" <+> "=" <+> body
@@ -228,24 +308,32 @@
   where
     precPattern = case precCat c of 0 -> "_" ; p -> integer p
     body = mkRhs ["x", "xs"] rhs
+mkPrtListCase _ = error "mkPrtListCase undefined for non-list categories"
 
 
 -- | Define an ordering on lists' rules with the following properties:
+--
 -- - rules with a higher coercion level should come first, i.e. the rules for
 --   [Foo3] are before rules for [Foo1] and they are both lower than rules for
 --   [Foo].
+--
 -- - [] < [_] < _:_
+--
 -- This is desiged to correctly order the rules in the prtList function so that
 -- the pattern matching works as expectd.
 --
 -- >>> compareRules (Rule "[]" (ListCat (CoercCat "Foo" 3)) []) (Rule "[]" (ListCat (CoercCat "Foo" 1)) [])
 -- LT
+--
 -- >>> compareRules (Rule "[]" (ListCat (CoercCat "Foo" 3)) []) (Rule "[]" (ListCat (Cat "Foo")) [])
 -- LT
+--
 -- >>> compareRules (Rule "[]" (ListCat (Cat "Foo")) []) (Rule "(:[])" (ListCat (Cat "Foo")) [])
 -- LT
+--
 -- >>> compareRules (Rule "(:[])" (ListCat (Cat "Foo")) []) (Rule "(:)" (ListCat (Cat "Foo")) [])
 -- LT
+--
 compareRules :: Rule -> Rule -> Ordering
 compareRules r1 r2 | precRule r1 > precRule r2 = LT
 compareRules r1 r2 | precRule r1 < precRule r2 = GT
@@ -260,21 +348,24 @@
 
 
 -- |
+--
 -- >>> mkRhs ["expr1", "n", "expr2"] [Left (Cat "Expr"), Right "-", Left (TokenCat "Integer"), Left (Cat "Expr")]
--- (concatD [prt 0 expr1, doc (showString "-"), prt 0 n, prt 0 expr2])
+-- concatD [prt 0 expr1, doc (showString "-"), prt 0 n, prt 0 expr2]
 --
 -- Coercions on the right hand side should be passed to prt:
+--
 -- >>> mkRhs ["expr1"] [Left (CoercCat "Expr" 2)]
--- (concatD [prt 2 expr1])
+-- concatD [prt 2 expr1]
+--
 -- >>> mkRhs ["expr2s"] [Left (ListCat (CoercCat "Expr" 2))]
--- (concatD [prt 2 expr2s])
+-- concatD [prt 2 expr2s]
+--
 mkRhs :: [String] -> [Either Cat String] -> Doc
 mkRhs args its =
-    parens ("concatD" <+> brackets (hsep (punctuate "," (mk args its))))
- where
+  "concatD" <+> brackets (hsep (punctuate "," (mk args its)))
+  where
   mk args (Left InternalCat : items) = mk args items
   mk (arg:args) (Left c  : items)    = (prt c <+> text arg) : mk args items
   mk args       (Right s : items)    = ("doc (showString" <+> text (show s) <> ")") : mk args items
   mk _          _                    = []
   prt c = "prt" <+> integer (precCat c)
-
diff --git a/src/BNFC/Backend/Haskell/CFtoTemplate.hs b/src/BNFC/Backend/Haskell/CFtoTemplate.hs
--- a/src/BNFC/Backend/Haskell/CFtoTemplate.hs
+++ b/src/BNFC/Backend/Haskell/CFtoTemplate.hs
@@ -1,3 +1,5 @@
+{-# LANGUAGE NoImplicitPrelude #-}
+
 {-
     BNF Converter: Template Generator
     Copyright (C) 2004  Author:  Markus Forberg
@@ -14,11 +16,13 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 
 module BNFC.Backend.Haskell.CFtoTemplate (cf2Template) where
+
+import Prelude'
 
 import BNFC.Backend.Haskell.Utils (catvars)
 import BNFC.CF
diff --git a/src/BNFC/Backend/Haskell/MkErrM.hs b/src/BNFC/Backend/Haskell/MkErrM.hs
--- a/src/BNFC/Backend/Haskell/MkErrM.hs
+++ b/src/BNFC/Backend/Haskell/MkErrM.hs
@@ -1,3 +1,5 @@
+{-# LANGUAGE NoImplicitPrelude #-}
+
 {-
     BNF Converter: Haskell error monad
     Copyright (C) 2004-2007  Author:  Markus Forberg, Peter Gammie,
@@ -15,46 +17,55 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 module BNFC.Backend.Haskell.MkErrM where
-errM :: String -> b -> String
-errM errMod _ = 
-  unlines
-    ["-- BNF Converter: Error Monad"
-    ,"-- Copyright (C) 2004  Author:  Aarne Ranta"
-    ,""
-    ,"-- This file comes with NO WARRANTY and may be used FOR ANY PURPOSE."
-    ,"module " ++ errMod ++ " where"
-    ,""
-    ,"-- the Error monad: like Maybe type with error msgs"
-    ,""
-    ,"import Control.Monad (MonadPlus(..), liftM)"
-    ,"import Control.Applicative (Applicative(..), Alternative(..))"
-    ,""
-    ,"data Err a = Ok a | Bad String"
-    ,"  deriving (Read, Show, Eq, Ord)"
-    ,""
-    ,"instance Monad Err where"
-    ,"  return      = Ok"
-    ,"  fail        = Bad"
-    ,"  Ok a  >>= f = f a"
-    ,"  Bad s >>= _ = Bad s"
-    ,""
-    ,"instance Applicative Err where"
-    ,"  pure = Ok"
-    ,"  (Bad s) <*> _ = Bad s"
-    ,"  (Ok f) <*> o  = liftM f o"
-    ,""
-    ,""
-    ,"instance Functor Err where"
-    ,"  fmap = liftM"
-    ,""
-    ,"instance MonadPlus Err where"
-    ,"  mzero = Bad \"Err.mzero\""
-    ,"  mplus (Bad _) y = y"
-    ,"  mplus x       _ = x"
-    ,""
-    ,"instance Alternative Err where"
-    ,"  empty = mzero"
-    ,"  (<|>) = mplus"]
+
+import Prelude'
+
+import BNFC.PrettyPrint
+
+mkErrM :: String -> Bool -> Doc
+mkErrM errMod ghc = vcat
+    [ if ghc then "{-# LANGUAGE CPP #-}" else empty
+    , "-- BNF Converter: Error Monad"
+    , "-- Copyright (C) 2004  Author:  Aarne Ranta"
+    , ""
+    , "-- This file comes with NO WARRANTY and may be used FOR ANY PURPOSE."
+    , "module " <> text errMod <> " where"
+    , ""
+    , "-- the Error monad: like Maybe type with error msgs"
+    , ""
+    , "import Control.Monad (MonadPlus(..), liftM)"
+    , if ghc then "#if __GLASGOW_HASKELL__ < 710" else empty
+    , "import Control.Applicative (Applicative(..), Alternative(..))"
+    , if ghc then "#else" else empty
+    , if ghc then "import Control.Applicative (Alternative(..))" else empty
+    , if ghc then "#endif" else empty
+    , ""
+    , "data Err a = Ok a | Bad String"
+    , "  deriving (Read, Show, Eq, Ord)"
+    , ""
+    , "instance Monad Err where"
+    , "  return      = Ok"
+    , "  fail        = Bad"
+    , "  Ok a  >>= f = f a"
+    , "  Bad s >>= _ = Bad s"
+    , ""
+    , "instance Applicative Err where"
+    , "  pure = Ok"
+    , "  (Bad s) <*> _ = Bad s"
+    , "  (Ok f) <*> o  = liftM f o"
+    , ""
+    , "instance Functor Err where"
+    , "  fmap = liftM"
+    , ""
+    , "instance MonadPlus Err where"
+    , "  mzero = Bad \"Err.mzero\""
+    , "  mplus (Bad _) y = y"
+    , "  mplus x       _ = x"
+    , ""
+    , "instance Alternative Err where"
+    , "  empty = mzero"
+    , "  (<|>) = mplus"
+    ]
diff --git a/src/BNFC/Backend/Haskell/MkSharedString.hs b/src/BNFC/Backend/Haskell/MkSharedString.hs
--- a/src/BNFC/Backend/Haskell/MkSharedString.hs
+++ b/src/BNFC/Backend/Haskell/MkSharedString.hs
@@ -14,7 +14,7 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 module BNFC.Backend.Haskell.MkSharedString where
 
diff --git a/src/BNFC/Backend/Haskell/RegToAlex.hs b/src/BNFC/Backend/Haskell/RegToAlex.hs
--- a/src/BNFC/Backend/Haskell/RegToAlex.hs
+++ b/src/BNFC/Backend/Haskell/RegToAlex.hs
@@ -14,7 +14,7 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 module BNFC.Backend.Haskell.RegToAlex (printRegAlex) where
@@ -82,6 +82,3 @@
    RUpper  -> prPrec i 3 (concat [["^c"]])
    RLower  -> prPrec i 3 (concat [["^s"]])
    RAny  -> prPrec i 3 (concat [["^u"]])
-
-
-
diff --git a/src/BNFC/Backend/Haskell/ToCNF.hs b/src/BNFC/Backend/Haskell/ToCNF.hs
--- a/src/BNFC/Backend/Haskell/ToCNF.hs
+++ b/src/BNFC/Backend/Haskell/ToCNF.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE TypeSynonymInstances, FlexibleInstances #-}
+{-# LANGUAGE TypeSynonymInstances, FlexibleInstances, CPP #-}
 {-
     Copyright (C) 2012  Authors:
     Jean-Philippe Bernardy.
@@ -15,7 +15,7 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 {-# LANGUAGE OverloadedStrings #-}
@@ -33,9 +33,11 @@
 import BNFC.ToCNFCore
 import BNFC.CF hiding (App,Exp)
 import BNFC.Backend.Haskell.HsOpts
-import Control.Monad.RWS
+#if __GLASGOW_HASKELL__ < 710
 import Control.Applicative hiding (Const)
+#endif
 import qualified Data.Map as M
+import Data.Monoid
 import Data.Pair
 import Text.PrettyPrint.HughesPJ hiding (first,(<>))
 
@@ -78,7 +80,6 @@
        = vcat ["{-# LANGUAGE MagicHash, FlexibleInstances #-}"
               ,"module " <> text (cnfTablesFileM opts) <> " where"
               ,"import GHC.Prim"
-              ,"import GHC.Exts"
               ,"import Control.Applicative hiding (Const)"
               ,"import Algebra.RingUtils"
               ,"import Parsing.Chart ()"
@@ -133,7 +134,7 @@
 
 
 genCombine :: UnitRel Cat -> CFG Exp -> Doc
-genCombine units cf = vcat $ map genEntry $ group' $ map (alt units) (rulesOfCF cf)
+genCombine units cf = vcat $ map genEntry $ group' $ map (alt units) (cfgRules cf)
   where genEntry :: ((RHSEl,RHSEl),[(Cat,Exp)]) -> Doc
         genEntry ((r1,r2),cs) = "combine p " <> catTag r1 <> " " <> catTag r2 <> " = " <> prettyPair (genList <$> splitOptim (Left . fst) cf cs)
         mkLam body = "\\x y -> " <> body
@@ -216,5 +217,3 @@
    ,"      work [c1,c2] = show $ map fst $ root $ mergein False c1 x c2"
    ,"  defaultMain [bench f $ nf work cs] -- note the hack!!!"
    ]
-
-
diff --git a/src/BNFC/Backend/Haskell/Utils.hs b/src/BNFC/Backend/Haskell/Utils.hs
--- a/src/BNFC/Backend/Haskell/Utils.hs
+++ b/src/BNFC/Backend/Haskell/Utils.hs
@@ -1,9 +1,13 @@
+{-# LANGUAGE NoImplicitPrelude #-}
+
 module BNFC.Backend.Haskell.Utils
   ( parserName
   , hsReservedWords
   , catToType
   , catvars
   ) where
+
+import Prelude'
 
 import Text.PrettyPrint
 import BNFC.CF (Cat(..), identCat, normCat)
diff --git a/src/BNFC/Backend/HaskellGADT.hs b/src/BNFC/Backend/HaskellGADT.hs
--- a/src/BNFC/Backend/HaskellGADT.hs
+++ b/src/BNFC/Backend/HaskellGADT.hs
@@ -15,7 +15,7 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 module BNFC.Backend.HaskellGADT (makeHaskellGadt) where
@@ -73,7 +73,7 @@
     mkfile (printerFile opts)  $ cf2Printer False False True prMod absMod cf
     when (hasLayout cf) $ mkfile (layoutFile opts) $ cf2Layout (alexMode opts == Alex1) (inDir opts) layMod lexMod cf
     mkfile (tFile opts)        $ Haskell.testfile opts cf
-    mkfile (errFile opts)      $ errM errMod cf
+    mkfile (errFile opts) $ mkErrM errMod (ghcExtensions opts)
     when (shareStrings opts) $ mkfile (shareFile opts)    $ sharedString shareMod (byteStrings opts) cf
     Makefile.mkMakefile opts $ Haskell.makefile opts
     case xml opts of
diff --git a/src/BNFC/Backend/HaskellGADT/CFtoAbstractGADT.hs b/src/BNFC/Backend/HaskellGADT/CFtoAbstractGADT.hs
--- a/src/BNFC/Backend/HaskellGADT/CFtoAbstractGADT.hs
+++ b/src/BNFC/Backend/HaskellGADT/CFtoAbstractGADT.hs
@@ -1,146 +1,146 @@
-{-
-    BNF Converter: GADT Abstract syntax Generator
-    Copyright (C) 2004-2005  Author:  Markus Forberg, Björn Bringert
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
--}
-
-module BNFC.Backend.HaskellGADT.CFtoAbstractGADT (cf2Abstract) where
-
-import BNFC.CF
-import BNFC.Utils((+++))
-import Data.List(intersperse,intercalate,nub)
-
-import BNFC.Backend.HaskellGADT.HaskellGADTCommon
-
--- to produce a Haskell module
-cf2Abstract :: Bool -> String -> CF -> String -> String
-cf2Abstract byteStrings name cf composOpMod = unlines $ [
-  "{-# LANGUAGE GADTs, KindSignatures, DataKinds #-}",
-  "module" +++ name +++ "(" ++ concat (intersperse ", " exports) ++ ")" +++ "where",
-  "",
-  "import " ++ composOpMod,
-  "",
-  "import Data.Monoid (mappend)",
-  (if byteStrings then "import qualified Data.ByteString.Char8 as BS" else ""),
-  "",
-  "-- Haskell module generated by the BNF converter",
-  ""]
-  ++ prDummyTypes cf
-  ++ [""]
-  ++ prTreeType byteStrings cf
-  ++ [""]
-  ++ prCompos cf
-  ++ [""]
-  ++ prShow cf
-  ++ [""]
-  ++ prEq cf
-  ++ [""]
-  ++ prOrd cf
- where exports = ["Tree(..)"]
-                 ++ getTreeCats cf
-                 ++ ["johnMajorEq"]
-                 ++ ["module " ++ composOpMod]
-
-getTreeCats :: CF -> [String]
-getTreeCats cf = nub $ map show $ filter (not . isList) $ map consCat $ cf2cons cf
-
-prDummyTypes :: CF -> [String]
-prDummyTypes cf = [prDummyData] ++ map prDummyType cats
-  where
-  cats = getTreeCats cf
-  prDummyData = "data Tag =" +++ intercalate " | " (map mkRealType cats)
-  prDummyType cat = "type" +++ cat +++ "= Tree" +++ mkRealType cat
-
-mkRealType :: String -> String
-mkRealType cat = cat ++ "_" -- FIXME: make sure that there is no such category already
-
-prTreeType :: Bool -> CF -> [String]
-prTreeType byteStrings cf = ["data Tree :: Tag -> * where"] ++ map (("    "++) . prTreeCons) (cf2cons cf)
- where
- prTreeCons c
-      | isPositionCat cf cat = fun +++ ":: ((Int,Int),"++stringType++") -> Tree" +++ mkRealType (show cat)
-      | otherwise = fun +++ "::" +++ concat [show c +++ "-> " | (c,_) <- consVars c] ++ "Tree" +++ mkRealType (show cat)
-  where (cat,fun) = (consCat c, consFun c)
-        stringType
-          | byteStrings = "BS.ByteString"
-          | otherwise   = "String"
-
-prCompos :: CF -> [String]
-prCompos cf =
-    ["instance Compos Tree where",
-     "  compos r a f t = case t of"]
-    ++ map ("      "++) (concatMap prComposCons cs
-                         ++ if not (all isRecursive cs) then ["_ -> r t"] else [])
-    where
-    cs = cf2cons cf
-    prComposCons c
-	| isRecursive c = [consFun c +++ unwords (map snd (consVars c)) +++ "->" +++ rhs c]
-        | otherwise = []
-    isRecursive c = any (isTreeType cf) (map fst (consVars c))
-    rhs c = "r" +++ consFun c +++ unwords (map prRec (consVars c))
-	where prRec (cat,var) | not (isTreeType cf cat) = "`a`" +++ "r" +++ var
-			      | isList cat = "`a` foldr (a . a (r (:)) . f) (r [])" +++ var
-			      | otherwise = "`a`" +++ "f" +++ var
-
-prShow :: CF -> [String]
-prShow cf = ["instance Show (Tree c) where",
-	     "  showsPrec n t = case t of"]
-	     ++ map ("    "++) (map prShowCons cs)
-	     ++ ["   where opar n = if n > 0 then showChar '(' else id",
-	         "         cpar n = if n > 0 then showChar ')' else id"]
-  where
-  cs = cf2cons cf
-  prShowCons c | null vars = fun +++ "->" +++ "showString" +++ show fun
-	       | otherwise = fun +++ unwords (map snd vars) +++ "->"
-			     +++ "opar n . showString" +++ show fun
-			     +++ unwords [". showChar ' ' . showsPrec 1 " ++ x | (_,x) <- vars]
-			     +++ ". cpar n"
-      where (fun, vars) = (consFun c, consVars c)
-
-prEq :: CF -> [String]
-prEq cf = ["instance Eq (Tree c) where (==) = johnMajorEq",
-	   "",
-	   "johnMajorEq :: Tree a -> Tree b -> Bool"]
-           ++ map (prEqCons) (cf2cons cf)
-           ++ ["johnMajorEq _ _ = False"]
-  where prEqCons c
-	    | null vars = "johnMajorEq" +++ fun +++ fun +++ "=" +++ "True"
-	    | otherwise = "johnMajorEq" +++ "(" ++ fun +++ unwords vars ++ ")"
-			  +++ "(" ++ fun +++ unwords vars' ++ ")" +++ "="
-			  +++ (concat $ intersperse " && " $ zipWith (\x y -> x +++ "==" +++ y) vars vars')
-	    where (fun, vars) = (consFun c, map snd (consVars c))
-		  vars' = map (++"_") vars
-
-prOrd :: CF -> [String]
-prOrd cf = ["instance Ord (Tree c) where",
-            "  compare x y = compare (index x) (index y) `mappend` compareSame x y"] ++
-           ["index :: Tree c -> Int"] ++
-           zipWith (\ c i -> mkIndex c i) cs [0..] ++
-           ["compareSame :: Tree c -> Tree c -> Ordering"] ++
-           map mkCompareSame cs ++
-           ["compareSame x y = error \"BNFC error:\" compareSame"]
-  where cs = cf2cons cf
-        mkCompareSame c
-            | null vars = "compareSame" +++ fun +++ fun +++ "=" +++ "EQ"
-            | otherwise = "compareSame" +++ "(" ++ fun +++ unwords vars ++ ")"
-			  +++ "(" ++ fun +++ unwords vars' ++ ")" +++ "="
-                          +++ foldr1 (\x y -> "mappend (" ++ x ++") ("++y++")") cc
-            where (fun, vars) = (consFun c, map snd (consVars c))
-		  vars' = map (++"_") vars
-                  cc = zipWith (\x y -> "compare"+++x+++y) vars vars'
-        mkIndex c i = "index" +++ "(" ++ consFun c
-                       +++ unwords (replicate (length (consVars c)) "_") ++ ")"
-                       +++ "=" +++ show i
+{-
+    BNF Converter: GADT Abstract syntax Generator
+    Copyright (C) 2004-2005  Author:  Markus Forberg, Björn Bringert
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
+-}
+
+module BNFC.Backend.HaskellGADT.CFtoAbstractGADT (cf2Abstract) where
+
+import BNFC.CF
+import BNFC.Utils((+++))
+import Data.List(intercalate, nub)
+
+import BNFC.Backend.HaskellGADT.HaskellGADTCommon
+
+-- to produce a Haskell module
+cf2Abstract :: Bool -> String -> CF -> String -> String
+cf2Abstract byteStrings name cf composOpMod = unlines $ [
+  "{-# LANGUAGE GADTs, KindSignatures, DataKinds #-}",
+  "module" +++ name +++ "(" ++ intercalate ", " exports ++ ")" +++ "where",
+  "",
+  "import " ++ composOpMod,
+  "",
+  "import Data.Monoid (mappend)",
+  if byteStrings then "import qualified Data.ByteString.Char8 as BS" else "",
+  "",
+  "-- Haskell module generated by the BNF converter",
+  ""]
+  ++ prDummyTypes cf
+  ++ [""]
+  ++ prTreeType byteStrings cf
+  ++ [""]
+  ++ prCompos cf
+  ++ [""]
+  ++ prShow cf
+  ++ [""]
+  ++ prEq cf
+  ++ [""]
+  ++ prOrd cf
+ where exports = ["Tree(..)"]
+                 ++ getTreeCats cf
+                 ++ ["johnMajorEq"]
+                 ++ ["module " ++ composOpMod]
+
+getTreeCats :: CF -> [String]
+getTreeCats cf = nub $ map show $ filter (not . isList) $ map consCat $ cf2cons cf
+
+prDummyTypes :: CF -> [String]
+prDummyTypes cf = prDummyData : map prDummyType cats
+  where
+  cats = getTreeCats cf
+  prDummyData = "data Tag =" +++ intercalate " | " (map mkRealType cats)
+  prDummyType cat = "type" +++ cat +++ "= Tree" +++ mkRealType cat
+
+mkRealType :: String -> String
+mkRealType cat = cat ++ "_" -- FIXME: make sure that there is no such category already
+
+prTreeType :: Bool -> CF -> [String]
+prTreeType byteStrings cf = "data Tree :: Tag -> * where" : map (("    "++) . prTreeCons) (cf2cons cf)
+ where
+ prTreeCons c
+      | isPositionCat cf cat = fun +++ ":: ((Int,Int),"++stringType++") -> Tree" +++ mkRealType (show cat)
+      | otherwise = fun +++ "::" +++ concat [show c +++ "-> " | (c,_) <- consVars c] ++ "Tree" +++ mkRealType (show cat)
+  where (cat,fun) = (consCat c, consFun c)
+        stringType
+          | byteStrings = "BS.ByteString"
+          | otherwise   = "String"
+
+prCompos :: CF -> [String]
+prCompos cf =
+    ["instance Compos Tree where",
+     "  compos r a f t = case t of"]
+    ++ map ("      "++) (concatMap prComposCons cs
+                         ++ ["_ -> r t" | not (all isRecursive cs)])
+  where
+    cs = cf2cons cf
+    prComposCons c
+        | isRecursive c = [consFun c +++ unwords (map snd (consVars c)) +++ "->" +++ rhs c]
+        | otherwise = []
+    isRecursive c = any (isTreeType cf) (map fst (consVars c))
+    rhs c = "r" +++ consFun c +++ unwords (map prRec (consVars c))
+      where prRec (cat,var) | not (isTreeType cf cat) = "`a`" +++ "r" +++ var
+                            | isList cat = "`a` foldr (\\ x z -> r (:) `a` f x `a` z) (r [])" +++ var
+                            | otherwise = "`a`" +++ "f" +++ var
+
+prShow :: CF -> [String]
+prShow cf = ["instance Show (Tree c) where",
+              "  showsPrec n t = case t of"]
+              ++ map (("    "++) .prShowCons) cs
+              ++ ["   where opar n = if n > 0 then showChar '(' else id",
+                  "         cpar n = if n > 0 then showChar ')' else id"]
+  where
+    cs = cf2cons cf
+    prShowCons c | null vars = fun +++ "->" +++ "showString" +++ show fun
+                 | otherwise = fun +++ unwords (map snd vars) +++ "->"
+                                   +++ "opar n . showString" +++ show fun
+                                   +++ unwords [". showChar ' ' . showsPrec 1 " ++ x | (_,x) <- vars]
+                                   +++ ". cpar n"
+      where (fun, vars) = (consFun c, consVars c)
+
+prEq :: CF -> [String]
+prEq cf = ["instance Eq (Tree c) where (==) = johnMajorEq",
+           "",
+           "johnMajorEq :: Tree a -> Tree b -> Bool"]
+           ++ map prEqCons (cf2cons cf)
+           ++ ["johnMajorEq _ _ = False"]
+  where prEqCons c
+            | null vars = "johnMajorEq" +++ fun +++ fun +++ "=" +++ "True"
+            | otherwise = "johnMajorEq" +++ "(" ++ fun +++ unwords vars ++ ")"
+                          +++ "(" ++ fun +++ unwords vars' ++ ")" +++ "="
+                          +++ intercalate " && " (zipWith (\x y -> x +++ "==" +++ y) vars vars')
+          where (fun, vars) = (consFun c, map snd (consVars c))
+                vars' = map (++"_") vars
+
+prOrd :: CF -> [String]
+prOrd cf = ["instance Ord (Tree c) where",
+            "  compare x y = compare (index x) (index y) `mappend` compareSame x y"] ++
+           ["index :: Tree c -> Int"] ++
+           zipWith mkIndex cs [0..] ++
+           ["compareSame :: Tree c -> Tree c -> Ordering"] ++
+           map mkCompareSame cs ++
+           ["compareSame x y = error \"BNFC error:\" compareSame"]
+  where cs = cf2cons cf
+        mkCompareSame c
+            | null vars = "compareSame" +++ fun +++ fun +++ "=" +++ "EQ"
+            | otherwise = "compareSame" +++ "(" ++ fun +++ unwords vars ++ ")"
+                          +++ "(" ++ fun +++ unwords vars' ++ ")" +++ "="
+                          +++ foldr1 (\x y -> "mappend (" ++ x ++") ("++y++")") cc
+            where (fun, vars) = (consFun c, map snd (consVars c))
+                  vars' = map (++"_") vars
+                  cc = zipWith (\x y -> "compare"+++x+++y) vars vars'
+        mkIndex c i = "index" +++ "(" ++ consFun c
+                       +++ unwords (replicate (length (consVars c)) "_") ++ ")"
+                       +++ "=" +++ show i
diff --git a/src/BNFC/Backend/HaskellGADT/CFtoTemplateGADT.hs b/src/BNFC/Backend/HaskellGADT/CFtoTemplateGADT.hs
--- a/src/BNFC/Backend/HaskellGADT/CFtoTemplateGADT.hs
+++ b/src/BNFC/Backend/HaskellGADT/CFtoTemplateGADT.hs
@@ -14,13 +14,11 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 
-module BNFC.Backend.HaskellGADT.CFtoTemplateGADT (
-		    cf2Template
-                    ) where
+module BNFC.Backend.HaskellGADT.CFtoTemplateGADT (cf2Template) where
 
 import BNFC.CF
 import BNFC.Utils((+++))
@@ -61,6 +59,6 @@
 catEq c1 c2 = consCat c1 == consCat c2
 
 prCatTrans :: Cat -> [Constructor] -> [String]
-prCatTrans cat cs = ["trans" ++ show cat +++ "::" +++ show cat +++ "-> Result",
-		     "trans" ++ show cat +++ "t = case t of"]
-		    ++ map prConsCase cs
+prCatTrans cat cs = ["trans" ++ show cat +++ "::" +++ show cat +++ "-> Result"
+                    , "trans" ++ show cat +++ "t = case t of"]
+                    ++ map prConsCase cs
diff --git a/src/BNFC/Backend/HaskellGADT/HaskellGADTCommon.hs b/src/BNFC/Backend/HaskellGADT/HaskellGADTCommon.hs
--- a/src/BNFC/Backend/HaskellGADT/HaskellGADTCommon.hs
+++ b/src/BNFC/Backend/HaskellGADT/HaskellGADTCommon.hs
@@ -14,7 +14,7 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 module BNFC.Backend.HaskellGADT.HaskellGADTCommon (Constructor(..), cf2cons, isTreeType) where
@@ -23,32 +23,30 @@
 
 import Data.Char
 
-data Constructor = Constructor {
-				consCat :: Cat,
-				consFun :: Fun,
-				consPrec :: Integer,
-				consVars :: [(Cat,String)],
-				consRhs :: [Either Cat String]
-			       }
+data Constructor = Constructor
+    { consCat :: Cat
+    , consFun :: Fun
+    , consPrec :: Integer
+    , consVars :: [(Cat,String)]
+    , consRhs :: [Either Cat String]
+    }
 
 -- | Get category, function, and rhs categories paired with variable names.
 cf2cons :: CF -> [Constructor]
-cf2cons cf = [  Constructor { consCat = cat,
-			      consFun = fun,
-			      consPrec = precFun cf fun,
-			      consVars = zip cats (mkVars cats),
-			      consRhs = rhsFun cf fun}
-		| (cat,rules) <- cf2data cf, (fun,cats) <- rules]
-	     ++ [ Constructor { consCat = cat,
-				consFun = show cat,
-				consPrec = 0,
-				consVars = [(Cat "String","str")],
-				consRhs = [Left (Cat "String")]}
-		  | cat <- specialCats cf]
- where mkVars cats = mkUnique (map catToVar cats) (0 :: Int)
-       mkUnique [] _ = []
-       mkUnique (x:xs) n | elem x xs || n > 0 = (x ++ show n) : mkUnique xs (n+1)
-			 | otherwise = x : mkUnique xs n
+cf2cons cf =
+    [  Constructor
+        { consCat = cat, consFun = fun, consPrec = precFun cf fun
+        , consVars = zip cats (mkVars cats), consRhs = rhsFun cf fun
+        } | (cat,rules) <- cf2data cf, (fun,cats) <- rules]
+    ++ [ Constructor
+        { consCat = cat, consFun = show cat, consPrec = 0
+        , consVars = [(Cat "String","str")], consRhs = [Left (Cat "String")]
+        } | cat <- specialCats cf]
+  where
+    mkVars cats = mkUnique (map catToVar cats) (0 :: Int)
+    mkUnique [] _ = []
+    mkUnique (x:xs) n | x `elem` xs || n > 0 = (x ++ show n) : mkUnique xs (n+1)
+                      | otherwise = x : mkUnique xs n
 
 -- | Make a variable name for a category.
 catToVar :: Cat -> String
@@ -60,15 +58,16 @@
         var (Cat "Char")    = "c"
         var (Cat "Double")  = "d"
         var xs        = map toLower $show xs
-        checkRes s | elem s reservedHaskell = s ++ "'"
-		   | otherwise              = s
-	reservedHaskell = ["case","class","data","default","deriving","do","else","if",
-			   "import","in","infix","infixl","infixr","instance","let","module",
-			   "newtype","of","then","type","where","as","qualified","hiding"]
+        checkRes s |  s `elem` reservedHaskell = s ++ "'"
+                   | otherwise              = s
+        reservedHaskell =
+            ["case","class","data","default","deriving","do","else","if"
+            , "import","in","infix","infixl","infixr","instance","let","module"
+            , "newtype","of","then","type","where","as","qualified","hiding"]
 
 -- | Get the rule for a function.
 ruleFun :: CF -> Fun -> Rule
-ruleFun cf f = head $ filter (\r -> funRule r == f) $ rulesOfCF cf
+ruleFun cf f = head $ filter (\r -> funRule r == f) $ cfgRules cf
 
 -- | Get the precedence of a function.
 precFun :: CF -> Fun -> Integer
diff --git a/src/BNFC/Backend/HaskellProfile.hs b/src/BNFC/Backend/HaskellProfile.hs
--- a/src/BNFC/Backend/HaskellProfile.hs
+++ b/src/BNFC/Backend/HaskellProfile.hs
@@ -14,7 +14,7 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 module BNFC.Backend.HaskellProfile (makeHaskellProfile) where
@@ -81,7 +81,7 @@
 ----      mkfile (layoutFile (inDir opts) name) $ cf2Layout alex1 (inDir opts) layMod lexMod cf
 ----      else return ()
     mkfile (tFile (inDir opts) name)        $ testfile (inDir opts) name (xml opts>0) cf
-    mkfile (errFile (inDir opts) name)      $ errM errMod cf
+    mkfile (errFile (inDir opts) name) $ mkErrM errMod (ghcExtensions opts)
     when (isJust $ make opts)
         (mkfile (mFile (inDir opts) name) $ makefile (inDir opts) name)
 ----    case xml of
diff --git a/src/BNFC/Backend/HaskellProfile/CFtoHappyProfile.hs b/src/BNFC/Backend/HaskellProfile/CFtoHappyProfile.hs
--- a/src/BNFC/Backend/HaskellProfile/CFtoHappyProfile.hs
+++ b/src/BNFC/Backend/HaskellProfile/CFtoHappyProfile.hs
@@ -14,14 +14,10 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
-module BNFC.Backend.HaskellProfile.CFtoHappyProfile
-       (
-       cf2HappyProfileS
-       )
-        where
+module BNFC.Backend.HaskellProfile.CFtoHappyProfile (cf2HappyProfileS) where
 
 import BNFC.CF
 --import Lexer
@@ -48,7 +44,7 @@
  = unlines
     [header name absName lexName errName,
      declarations (allEntryPoints cf),
-     tokens (symbols cf ++ reservedWords cf),
+     tokens (cfgSymbols cf ++ reservedWords cf),
      specialToks cf,
      delimiter,
      specialRules cf,
@@ -58,15 +54,14 @@
 -- construct the header.
 header :: String -> String -> String -> String -> String
 header modName _ lexName errName = unlines
-         ["-- This Happy file was machine-generated by the BNF converter",
-	  "{",
-          "module " ++ modName ++ " where",
-----          "import " ++ absName,
-          "import Trees",
-          "import " ++ lexName,
-          "import " ++ errName,
-          "}"
-         ]
+  [ "-- This Happy file was machine-generated by the BNF converter"
+  , "{"
+  , "module " ++ modName ++ " where"
+  , "import Trees"
+  , "import " ++ lexName
+  , "import " ++ errName
+  , "}"
+  ]
 
 
 -- The declarations of a happy file.
@@ -76,8 +71,8 @@
                   "%monad { Err } { thenM } { returnM }",
                   "%tokentype { " ++ tokenName ++ " }"]
    where generateP []     = []
-	 generateP (n:ns) = concat ["%name p",n'," ",n',"\n",generateP ns]
-                               where n' = identCat n
+         generateP (n:ns) = concat ["%name p",n'," ",n',"\n",generateP ns]
+             where n' = identCat n
 
 -- The useless delimiter symbol.
 delimiter :: String
@@ -87,7 +82,7 @@
 tokens :: [String] -> String
 tokens toks = "%token \n" ++ prTokens toks
  where prTokens []     = []
-       prTokens (t:tk) = " " ++ (convert t) ++
+       prTokens (t:tk) = " " ++ convert t ++
                          " { " ++ oneTok t ++ " }\n" ++
                          prTokens tk
        oneTok t = "PT _ (TS " ++ show t ++ ")"
@@ -95,11 +90,11 @@
 -- Happy doesn't allow characters such as åäö to occur in the happy file. This
 -- is however not a restriction, just a naming paradigm in the happy source file.
 convert :: String -> String
-convert "\\" = concat ['\'':"\\\\","\'"]
-convert xs   = concat ['\'':(escape xs),"\'"]
+convert "\\" = "'" ++ "\\\\" ++ "'"
+convert xs   = "'" ++ escape xs ++ "'"
   where escape [] = []
-	escape ('\'':xs) = '\\':'\'':escape xs
-	escape (x:xs) = x:escape xs
+        escape ('\'':xs) = '\\':'\'':escape xs
+        escape (x:xs) = x:escape xs
 
 rulesForHappy :: CFP -> Rules
 rulesForHappy cf = map mkOne $ ruleGroupsP cf where
@@ -119,9 +114,9 @@
      let (p,m) = generatePatterns cf r])
  where
    ---- left rec optimization does not work yet
-   revF _ r = ---- if b then ("flip " ++ funRuleP r) else (funRuleP r)
-              funRule r
-   revs = reversibleCats cf
+   revF _ = ---- if b then ("flip " ++ funRuleP r) else (funRuleP r)
+       funRule
+   revs = cfgReversibleCats cf
 
 -- Generates a string containing the semantic action.
 -- An action can for example be: Sum $1 $2, that is, construct an AST
@@ -145,10 +140,10 @@
      Left c -> identCat c
      Right s -> convert s
    metas its = [revIf c ('$': show i) | (i,Left c) <- zip [1 ::Int ..] its]
-   revIf c m = if (not (isConsFun (funRuleP r)) && elem c revs)
-                 then ("(reverse " ++ m ++ ")")
-               else m  -- no reversal in the left-recursive Cons rule itself
-   revs = reversibleCats cf
+   revIf c m = if not (isConsFun (funRuleP r)) && elem c revs
+                   then "(reverse " ++ m ++ ")"
+                   else m  -- no reversal in the left-recursive Cons rule itself
+   revs = cfgReversibleCats cf
 
 -- We have now constructed the patterns and actions,
 -- so the only thing left is to merge them into one string.
@@ -164,7 +159,7 @@
        nt' = identCat nt
        pr [] = []
        pr ((p,a):ls) =
-         unlines [(concat $ intersperse " " ["  |", p, "{", a , "}"])] ++ pr ls
+         unlines [unwords ["  |", p, "{", a , "}"]] ++ pr ls
 
 -- Finally, some haskell code.
 
@@ -190,18 +185,15 @@
 
 -- GF literals
 specialToks :: CFP -> String
-specialToks cf = unlines $
-		 (map aux (literals cf))
- where aux cat =
-        case cat of
-          Cat "Ident"  -> "L_ident  { PT _ (TV $$) }"
-          Cat "String" -> "L_quoted { PT _ (TL $$) }"
-          Cat "Integer" -> "L_integ  { PT _ (TI $$) }"
-          Cat "Double" -> "L_doubl  { PT _ (TD $$) }"
-          Cat "Char"   -> "L_charac { PT _ (TC $$) }"
-          own      -> "L_" ++ show own ++ " { PT _ (T_" ++ show own ++ " " ++ posn ++ ") }"
-         where
-           posn = if isPositionCat cf cat then "_" else "$$"
+specialToks cf = unlines (map aux (literals cf))
+  where aux cat = case cat of
+            Cat "Ident"  -> "L_ident  { PT _ (TV $$) }"
+            Cat "String" -> "L_quoted { PT _ (TL $$) }"
+            Cat "Integer" -> "L_integ  { PT _ (TI $$) }"
+            Cat "Double" -> "L_doubl  { PT _ (TD $$) }"
+            Cat "Char"   -> "L_charac { PT _ (TC $$) }"
+            own      -> "L_" ++ show own ++ " { PT _ (T_" ++ show own ++ " " ++ posn ++ ") }"
+          where posn = if isPositionCat cf cat then "_" else "$$"
 
 specialRules :: CFP -> String
 specialRules cf = unlines $
@@ -210,10 +202,10 @@
    aux cat =
      case cat of
          Cat "Ident"   -> "Ident   : L_ident  { mkAtTree (AV (Ident $1)) }"
-	 Cat "String"  -> "String  : L_quoted { mkAtTree (AS $1) }"
-	 Cat "Integer" -> "Integer : L_integ  { mkAtTree (AI ((read $1) :: Integer)) }"
-	 Cat "Double"  -> "Double  : L_doubl  { (read $1) :: Double }" ----
-	 Cat "Char"    -> "Char    : L_charac { (read $1) :: Char }"   ----
-	 own       -> show own ++ "    : L_" ++ show own ++ " { " ++ show own ++ " ("++ posn ++ "$1)}"
+         Cat "String"  -> "String  : L_quoted { mkAtTree (AS $1) }"
+         Cat "Integer" -> "Integer : L_integ  { mkAtTree (AI ((read $1) :: Integer)) }"
+         Cat "Double"  -> "Double  : L_doubl  { (read $1) :: Double }" ----
+         Cat "Char"    -> "Char    : L_charac { (read $1) :: Char }"   ----
+         own       -> show own ++ "    : L_" ++ show own ++ " { " ++ show own ++ " ("++ posn ++ "$1)}"
       where
          posn = if isPositionCat cf cat then "mkPosToken " else ""
diff --git a/src/BNFC/Backend/Java.hs b/src/BNFC/Backend/Java.hs
--- a/src/BNFC/Backend/Java.hs
+++ b/src/BNFC/Backend/Java.hs
@@ -1,3 +1,5 @@
+{-# LANGUAGE NoImplicitPrelude #-}
+
 {-
     BNF Converter: Java Top File
     Copyright (C) 2004  Author:  Markus Forsberg, Peter Gammie,
@@ -15,7 +17,7 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 -------------------------------------------------------------------
@@ -35,16 +37,20 @@
 
 module BNFC.Backend.Java ( makeJava ) where
 
--------------------------------------------------------------------
--- Dependencies.
--------------------------------------------------------------------
-import System.FilePath (pathSeparator)
+import Prelude'
+
+import System.FilePath (pathSeparator, isPathSeparator)
+import Data.List ( intersperse )
+
 import BNFC.Utils
 import BNFC.CF
 import BNFC.Options as Options
 import BNFC.Backend.Base
+import BNFC.Backend.Java.Utils
 import BNFC.Backend.Java.CFtoCup15 ( cf2Cup )
 import BNFC.Backend.Java.CFtoJLex15
+import BNFC.Backend.Java.CFtoAntlr4Lexer
+import BNFC.Backend.Java.CFtoAntlr4Parser
 import BNFC.Backend.Java.CFtoJavaAbs15 ( cf2JavaAbs )
 import BNFC.Backend.Java.CFtoJavaPrinter15
 import BNFC.Backend.Java.CFtoVisitSkel15
@@ -52,188 +58,611 @@
 import BNFC.Backend.Java.CFtoAbstractVisitor
 import BNFC.Backend.Java.CFtoFoldVisitor
 import BNFC.Backend.Java.CFtoAllVisitor
+import BNFC.Backend.Common.NamedVariables (SymEnv, firstLowerCase)
 import qualified BNFC.Backend.Common.Makefile as Makefile
 import BNFC.PrettyPrint
+
 -------------------------------------------------------------------
 -- | Build the Java output.
--- FIXME: get everything to put the files in the right places.
--- Adapt Makefile to do the business.
 -------------------------------------------------------------------
+
+-- | This creates the Java files.
 makeJava :: SharedOptions -> CF -> MkFiles ()
-makeJava options@Options{..} cf =
-    do -- Create the package directories if necessary.
-       let packageBase = case inPackage of
-                             Nothing -> lang
-                             Just p -> p ++ "." ++ lang
-           packageAbsyn = packageBase ++ "." ++ "Absyn"
-           dirBase = pkgToDir packageBase
-           dirAbsyn = pkgToDir packageAbsyn
-       let absynFiles = remDups $ cf2JavaAbs packageBase packageAbsyn cf
-           absynBaseNames = map fst absynFiles
-           absynFileNames = map (dirAbsyn ++) absynBaseNames
-       let writeAbsyn (filename, contents) =
-               mkfile (dirAbsyn ++ filename ++ ".java") contents
-       mapM_ writeAbsyn absynFiles
-       mkfile (dirBase ++ "PrettyPrinter.java") $ cf2JavaPrinter packageBase packageAbsyn cf
-       mkfile (dirBase ++ "VisitSkel.java") $ cf2VisitSkel packageBase packageAbsyn cf
-       mkfile (dirBase ++ "ComposVisitor.java") $ cf2ComposVisitor packageBase packageAbsyn cf
-       mkfile (dirBase ++ "AbstractVisitor.java") $ cf2AbstractVisitor packageBase packageAbsyn cf
-       mkfile (dirBase ++ "FoldVisitor.java") $ cf2FoldVisitor packageBase packageAbsyn cf
-       mkfile (dirBase ++ "AllVisitor.java") $ cf2AllVisitor packageBase packageAbsyn cf
-       mkfile (dirBase ++ "Test.java") $ render $ javaTest packageBase packageAbsyn cf
----       mkfile ("Test" ++ name) $ "java " ++ dirBase ++ "Test $(1)"
-       let (lex, env) = cf2jlex packageBase cf jflex
-       mkfile (dirBase ++ "Yylex") (render lex)
-       liftIO $ putStrLn "   (Tested with JLex 1.2.6.)"
-       mkfile (dirBase ++ lang ++ ".cup") $ cf2Cup packageBase packageAbsyn cf env
-       -- FIXME: put in a doc directory?
-       liftIO $ putStrLn $ "   (Parser created for category " ++ show (firstEntry cf) ++ ")"
-       liftIO $ putStrLn "   (Tested with CUP 0.10k)"
-       Makefile.mkMakefile options $ makefile lang dirBase dirAbsyn absynFileNames jflex
+makeJava options@Options{..} cf = do
+     -- Create the package directories if necessary.
+    let packageBase  = case inPackage of
+                           Nothing -> lang
+                           Just p -> p ++ "." ++ lang
+        packageAbsyn = packageBase ++ "." ++ "Absyn"
+        dirBase      = pkgToDir packageBase
+        dirAbsyn     = pkgToDir packageAbsyn
+        javaex str   = dirBase ++ str +.+ "java"
+        bnfcfiles    =
+          bnfcVisitorsAndTests
+            packageBase
+            packageAbsyn
+            cf
+            cf2JavaPrinter
+            cf2VisitSkel
+            cf2ComposVisitor
+            cf2AbstractVisitor
+            cf2FoldVisitor
+            cf2AllVisitor
+            (testclass parselexspec
+                (head $ results lexmake) -- lexer class
+                (head $ results parmake) -- parser class
+            )
+        makebnfcfile x = mkfile (javaex (fst $ x bnfcfiles))
+                                        (snd $ x bnfcfiles)
+
+    let absynFiles = remDups $ cf2JavaAbs packageBase packageAbsyn cf rp
+        absynBaseNames = map fst absynFiles
+        absynFileNames = map (dirAbsyn ++) absynBaseNames
+    let writeAbsyn (filename, contents) =
+          mkfile (dirAbsyn ++ filename ++ ".java") contents
+    mapM_ writeAbsyn absynFiles
+    makebnfcfile bprettyprinter
+    makebnfcfile bskel
+    makebnfcfile bcompos
+    makebnfcfile babstract
+    makebnfcfile bfold
+    makebnfcfile ball
+    makebnfcfile btest
+    let (lex, env) = lexfun packageBase cf
+    -- Where the lexer file is created. lex is the content!
+    mkfile (dirBase ++ inputfile lexmake ) lex
+    liftIO $ putStrLn $ "   (Tested with "+++ toolname lexmake
+                                          +++ toolversion lexmake  +++")"
+    -- where the parser file is created.
+    mkfile (dirBase ++ inputfile parmake)
+          $ parsefun packageBase packageAbsyn cf rp env
+    liftIO $ putStrLn $
+      if supportsEntryPoints parmake
+       then "(Parser created for all categories)"
+       else "   (Parser created only for category " ++ show (firstEntry cf) ++ ")"
+    liftIO $ putStrLn $ "   (Tested with " +++ toolname parmake
+                                           +++ toolversion parmake +++ ")"
+    Makefile.mkMakefile options $
+        makefile dirBase dirAbsyn absynFileNames parselexspec
+  where
+    remDups [] = []
+    remDups ((a,b):as) = case lookup a as of
+                           Just {} -> remDups as
+                           Nothing -> (a, b) : remDups as
+    pkgToDir :: String -> FilePath
+    pkgToDir s = replace '.' pathSeparator s ++ [pathSeparator]
+
+    parselexspec = parserLexerSelector lang javaLexerParser rp
+    lexfun       = cf2lex $ lexer parselexspec
+    parsefun     = cf2parse $ parser parselexspec
+    parmake      = makeparserdetails (parser parselexspec)
+    lexmake      = makelexerdetails  (lexer parselexspec)
+    rp           = (Options.linenumbers options)
+
+makefile ::  FilePath -> FilePath -> [String] -> ParserLexerSpecification -> Doc
+makefile  dirBase dirAbsyn absynFileNames jlexpar = vcat $
+    makeVars [  ("JAVAC", "javac"),
+                ("JAVAC_FLAGS", "-sourcepath ."),
+                ( "JAVA", "java"),
+                ( "JAVA_FLAGS", ""),
+            -- parser executable
+                ( "PARSER", executable parmake),
+            -- parser flags
+                ( "PARSER_FLAGS", flags parmake dirBase),
+             -- lexer executable (and flags?)
+                ( "LEXER", executable lexmake),
+                ( "LEXER_FLAGS", flags lexmake dirBase)
+    ]
+    ++
+    makeRules [ ("all", [ "test" ], []),
+                ( "test", "absyn" : classes, []),
+                ( ".PHONY", ["absyn"],     []),
+                ("%.class", [ "%.java" ],  [ runJavac "$^" ]),
+                ("absyn",   [absynJavaSrc],[ runJavac "$^" ])
+                ]++
+    [-- running the lexergen: output of lexer -> input of lexer : calls lexer
+    let ff = filename lexmake -- name of input file without extension
+        dirBaseff = dirBase ++ ff -- prepend directory
+        inp = dirBase ++ inputfile lexmake in
+        Makefile.mkRule (dirBaseff +.+ "java") [ inp ]
+        [ "${LEXER} ${LEXER_FLAGS} "++ inp ]
+
+    -- running the parsergen, these there are its outputs
+    -- output of parser -> input of parser : calls parser
+  , let inp = dirBase ++ inputfile parmake in
+        Makefile.mkRule (unwords (map (dirBase++) (dotJava $ results parmake)))
+          [ inp ] $
+          ("${PARSER} ${PARSER_FLAGS} " ++ inp) :
+          ["mv " ++ unwords (dotJava $ results parmake) +++ dirBase
+              | moveresults parmake]
+  -- Class of the output of lexer generator wants java of :
+  -- output of lexer and parser generator
+  , let lexerOutClass = dirBase ++ filename lexmake +.+ "class"
+        outname x = dirBase ++ x +.+ "java"
+        deps = map outname (results lexmake ++ results parmake) in
+        Makefile.mkRule lexerOutClass deps []
+    ]++
+  reverse [Makefile.mkRule tar dep [] |
+    (tar,dep) <- partialParserGoals dirBase (results parmake)]
+  ++[ Makefile.mkRule (dirBase ++ "PrettyPrinter.class")
+        [ dirBase ++ "PrettyPrinter.java" ] []
+    -- Removes all the class files created anywhere
+    , Makefile.mkRule "clean" [] [ "rm -f " ++ dirAbsyn ++ "*.class" ++ " "
+                                            ++ dirBase ++ "*.class" ]
+    -- Remains the same
+    , Makefile.mkRule "distclean" [ "vclean" ] []
+    -- removes everything
+    , Makefile.mkRule "vclean" []
+        [ " rm -f " ++ absynJavaSrc ++ " " ++ absynJavaClass
+        , " rm -f " ++ dirAbsyn ++ "*.class"
+        , " rmdir " ++ dirAbsyn
+        , " rm -f " ++ unwords (map (dirBase ++) $
+                    [ inputfile lexmake
+                    , inputfile parmake
+                    ]
+                    ++ dotJava (results lexmake)
+                    ++ [ "VisitSkel.java"
+                      , "ComposVisitor.java"
+                      , "AbstractVisitor.java"
+                      , "FoldVisitor.java"
+                      , "AllVisitor.java"
+                      , "PrettyPrinter.java"
+                      , "Skeleton.java"
+                      , "Test.java"
+                      ]
+                    ++ dotJava (results parmake)
+                    ++ ["*.class"])
+        , " rm -f Makefile"
+        , " rmdir -p " ++ dirBase
+        ]
+    ]
     where
-      remDups [] = []
-      remDups ((a,b):as) = case lookup a as of
-                             Just {} -> remDups as
-                             Nothing -> (a, b) : remDups as
+      makeVars x = [Makefile.mkVar n v | (n,v) <- x]
+      makeRules x = [Makefile.mkRule tar dep recipe  | (tar, dep, recipe) <- x]
+      parmake           = makeparserdetails (parser jlexpar)
+      lexmake           = makelexerdetails (lexer jlexpar)
+      absynJavaSrc      = unwords (dotJava absynFileNames)
+      absynJavaClass    = unwords (dotClass absynFileNames)
+      classes = prependPath dirBase lst
+      lst = dotClass (results lexmake) ++ [ "PrettyPrinter.class", "Test.class"
+          , "ComposVisitor.class", "AbstractVisitor.class"
+          , "FoldVisitor.class", "AllVisitor.class"]++
+           dotClass (results parmake) ++ ["Test.class"]
 
-      pkgToDir :: String -> FilePath
-      pkgToDir s = replace '.' pathSeparator s ++ [pathSeparator]
+type TestClass = String
+    -- ^ class of the lexer
+    -> String
+    -- ^ class of the parser
+    -> String
+    -- ^ package where the non-abstract syntax classes are created
+    -> String
+    -- ^ package where the abstract syntax classes are created
+    -> CF
+    -- ^ the CF bundle
+    -> String
 
--- FIXME get filenames right.
--- FIXME It's almost certainly better to just feed all the Java source
--- files to javac in one go.
--- Replace with an ANT script?
-makefile :: String -> FilePath -> FilePath -> [String] -> Bool -> String
-makefile name dirBase dirAbsyn absynFileNames jflex =
-    Makefile.mkVar "JAVAC" "javac"
-  $ Makefile.mkVar "JAVAC_FLAGS" "-sourcepath ."
-  $ Makefile.mkVar "JAVA" "java"
-  $ Makefile.mkVar "JAVA_FLAGS" ""
-  $ Makefile.mkVar "CUP" "java_cup.Main"
-  $ Makefile.mkVar "CUPFLAGS" "-nopositions -expect 100"
-  $ (if jflex then Makefile.mkVar "JFLEX" "jflex"
-              else Makefile.mkVar "JLEX" "JLex.Main" )
-  $ Makefile.mkRule "all" [ "test" ]
-    []
-  $ Makefile.mkRule "test" ("absyn" : map (dirBase ++) [ "Yylex.class",
-                                                       "PrettyPrinter.class",
-                                                       "Test.class",
-                                                       "ComposVisitor.class",
-                                                       "AbstractVisitor.class",
-                                                       "FoldVisitor.class",
-                                                       "AllVisitor.class",
-                                                       "parser.class",
-                                                       "sym.class",
-                                                       "Test.class"])
-    []
-  $ Makefile.mkRule ".PHONY" ["absyn"]
-    []
-  $ Makefile.mkRule "%.class" [ "%.java" ]
-    [ "${JAVAC} ${JAVAC_FLAGS} $^" ]
-  $ Makefile.mkRule "absyn" [absynJavaSrc]
-    [ "${JAVAC} ${JAVAC_FLAGS} $^" ]
-  $ Makefile.mkRule (dirBase ++ "Yylex.java") [ dirBase ++ "Yylex" ]
-    [ (if jflex then "${JFLEX} " else "${JAVA} ${JAVA_FLAGS} ${JLEX} ") ++ dirBase ++ "Yylex" ]
-  $ Makefile.mkRule (dirBase ++ "sym.java " ++ dirBase ++ "parser.java")
-                    [ dirBase ++ name ++ ".cup" ]
-    [ "${JAVA} ${JAVA_FLAGS} ${CUP} ${CUPFLAGS} " ++ dirBase ++ name ++ ".cup"
-    , "mv sym.java parser.java " ++ dirBase ]
-  $ Makefile.mkRule (dirBase ++ "Yylex.class") [ dirBase ++ "Yylex.java",
-                                                 dirBase ++ "sym.java" ]
-    []
-  $ Makefile.mkRule (dirBase ++ "sym.class") [ dirBase ++ "sym.java" ]
-    []
-  $ Makefile.mkRule (dirBase ++ "parser.class") [ dirBase ++ "parser.java"
-                                                , dirBase ++ "sym.java" ]
-    []
-  $ Makefile.mkRule (dirBase ++ "PrettyPrinter.class")
-                    [ dirBase ++ "PrettyPrinter.java" ]
-    []
--- FIXME
-  $ Makefile.mkRule "clean" []
-    [ "rm -f " ++ dirAbsyn ++ "*.class" ++ " " ++ dirBase ++ "*.class" ]
-  $ Makefile.mkRule "distclean" [ "vclean" ]
-    []
-  $ Makefile.mkRule "vclean" []
-    [ " rm -f " ++ absynJavaSrc ++ " " ++ absynJavaClass
-    , " rm -f " ++ dirAbsyn ++ "*.class"
---     , "rm -f " ++ "Test" ++ name
-    , " rmdir " ++ dirAbsyn
-    , " rm -f " ++ unwords (map (dirBase ++) [
-                                                "Yylex",
-                                                name ++ ".cup",
-                                                "Yylex.java",
-                                                "VisitSkel.java",
-                                                "ComposVisitor.java",
-                                                "AbstractVisitor.java",
-                                                "FoldVisitor.java",
-                                                "AllVisitor.java",
-                                                "PrettyPrinter.java",
-                                                "Skeleton.java",
-                                                "Test.java",
-                                                "sym.java",
-                                                "parser.java",
-                                                "*.class"])
-    , "rm -f Makefile"
-    , "rmdir -p " ++ dirBase ]
-  ""
-    where absynJavaSrc = unwords (map (++ ".java") absynFileNames)
-          absynJavaClass = unwords (map (++ ".class") absynFileNames)
+-- | Test class details for J(F)Lex + CUP
+cuptest :: TestClass
+cuptest =
+  javaTest
+    ["java_cup.runtime"]
+    "Throwable"
+    (const [])
+    (\x i -> x <> i <> ";")
+    (\x i -> x <> "(" <> i <> ", " <> i <> ".getSymbolFactory());")
+    showOpts
+    (\_ pabs enti ->
+        pabs <> "." <> enti <+> "ast = p."<> "p" <> enti
+             <> "();")
+    locs
+  where
+    locs = "At line \" + String.valueOf(t.l.line_num()) + \","
+            ++ " near \\\"\" + t.l.buff() + \"\\\" :"
+    showOpts _ = ["not available."]
 
-javaTest :: String -> String -> CF -> Doc
-javaTest packageBase packageAbsyn cf = vcat
-    [ "package" <+> text packageBase <> ";"
-    , "import java_cup.runtime.*;"
-    , "import" <+> text packageBase <> ".*;"
-    , "import" <+> text packageAbsyn <> ".*;"
-    , "import java.io.*;"
-    , ""
-    , "public class Test"
-    , codeblock 2
-        [ "public static void main(String args[]) throws Exception"
+
+
+-- | Test class details for ANTLR4
+antlrtest :: TestClass
+antlrtest =
+  javaTest
+    [ "org.antlr.v4.runtime","org.antlr.v4.runtime.atn"
+    , "org.antlr.v4.runtime.dfa","java.util"
+    ]
+    "TestError"
+    antlrErrorHandling
+    (\x i ->  vcat
+           [ x <> "(new ANTLRInputStream" <> i <>");"
+           , "l.addErrorListener(new BNFCErrorListener());"
+           ])
+    (\x i -> vcat
+           [x <> "(new CommonTokenStream(" <> i <>"));"
+           , "p.addErrorListener(new BNFCErrorListener());"
+           ])
+    showOpts
+    (\pbase pabs enti -> vcat
+           [
+           let rulename = getRuleName (show enti)
+               typename = text rulename
+               methodname = text $ firstLowerCase rulename
+           in
+               pbase <> "." <> typename <> "Context pc = p."
+                     <> methodname <> "();"
+               , "org.antlr.v4.runtime.Token _tkn = p.getInputStream()"
+                 <> ".getTokenSource().nextToken();"
+               , "if(_tkn.getType() != -1) throw new TestError"
+                 <> "(\"Stream does not end with EOF\","
+                 <> "_tkn.getLine(),_tkn.getCharPositionInLine());",
+               pabs <> "." <> enti <+> "ast = pc.result;"
+           ])
+           "At line \" + e.line + \", column \" + e.column + \" :"
+  where
+    showOpts [] = []
+    showOpts (x:xs)
+      | normCat x /= x = showOpts xs
+      | otherwise      = text (firstLowerCase $ identCat x) : showOpts xs
+
+parserLexerSelector :: String
+    -> JavaLexerParser
+    -> RecordPositions -- ^Pass line numbers to the symbols
+    -> ParserLexerSpecification
+parserLexerSelector _ JLexCup rp = ParseLexSpec
+    { lexer     = cf2JLex rp
+    , parser    = cf2cup rp
+    , testclass = cuptest
+    }
+parserLexerSelector _ JFlexCup rp =
+    (parserLexerSelector "" JLexCup rp){lexer = cf2JFlex rp}
+parserLexerSelector l Antlr4 _ = ParseLexSpec
+    { lexer     = cf2AntlrLex' l
+    , parser    = cf2AntlrParse' l
+    , testclass = antlrtest
+    }
+
+data ParserLexerSpecification = ParseLexSpec
+    { parser    :: CFToParser
+    , lexer     :: CFToLexer
+    , testclass :: TestClass
+    }
+
+-- |CF -> LEXER GENERATION TOOL BRIDGE
+-- | function translating the CF to an appropriate lexer generation tool.
+type CF2LexerFunction = String -> CF -> (Doc, SymEnv)
+
+-- Chooses the translation from CF to the lexer
+data CFToLexer = CF2Lex
+    { cf2lex           :: CF2LexerFunction
+    , makelexerdetails :: MakeFileDetails
+    }
+
+-- | Instances of cf-lexergen bridges
+cf2JLex, cf2JFlex :: RecordPositions -> CFToLexer
+
+cf2JLex rp = CF2Lex
+       { cf2lex           = BNFC.Backend.Java.CFtoJLex15.cf2jlex JLexCup rp
+       , makelexerdetails = jlexmakedetails
+       }
+
+cf2JFlex rp = CF2Lex
+       { cf2lex           = BNFC.Backend.Java.CFtoJLex15.cf2jlex JFlexCup rp
+       , makelexerdetails = jflexmakedetails
+       }
+
+cf2AntlrLex' :: String -> CFToLexer
+cf2AntlrLex' l = CF2Lex
+               { cf2lex           =
+                   BNFC.Backend.Java.CFtoAntlr4Lexer.cf2AntlrLex
+               , makelexerdetails = antlrmakedetails $ l++"Lexer"
+               }
+
+-- | CF -> PARSER GENERATION TOOL BRIDGE
+-- | function translating the CF to an appropriate parser generation tool.
+type CF2ParserFunction = String -> String -> CF -> RecordPositions -> SymEnv -> String
+
+-- | Chooses the translation from CF to the parser
+data CFToParser = CF2Parse
+    { cf2parse          :: CF2ParserFunction
+    , makeparserdetails :: MakeFileDetails
+    }
+
+-- | Instances of cf-parsergen bridges
+cf2cup :: RecordPositions -> CFToParser
+cf2cup rp = CF2Parse
+    { cf2parse          = BNFC.Backend.Java.CFtoCup15.cf2Cup
+    , makeparserdetails = cupmakedetails rp
+    }
+
+cf2AntlrParse' :: String -> CFToParser
+cf2AntlrParse' l = CF2Parse
+                { cf2parse          =
+                    BNFC.Backend.Java.CFtoAntlr4Parser.cf2AntlrParse
+                , makeparserdetails = antlrmakedetails $ l++"Parser"
+                }
+
+
+-- | shorthand for Makefile command running javac or java
+runJavac , runJava:: String -> String
+runJava   = mkRunProgram "JAVA"
+runJavac  = mkRunProgram "JAVAC"
+
+-- | function returning a string executing a program contained in a variable j
+-- on input s
+mkRunProgram :: String -> String -> String
+mkRunProgram j s = Makefile.refVar j +++ Makefile.refVar (j +-+ "FLAGS") +++ s
+
+type OutputDirectory = String
+
+-- | Makefile details from running the parser-lexer generation tools.
+data MakeFileDetails = MakeDetails
+    { -- | The string that executes the generation tool
+      executable          :: String
+      -- | Flags to pass to the tool
+    , flags               :: OutputDirectory -> String
+      -- | Input file to the tool
+    , filename            :: String
+      -- | Extension of input file to the tool
+    , fileextension       :: String
+      -- | name of the tool
+    , toolname            :: String
+      -- | Tool version
+    , toolversion         :: String
+      -- | true if the tool is a parser and supports entry points,
+      -- false otherwise
+    , supportsEntryPoints :: Bool
+      -- | list of names (without extension!) of files resulting from the
+      -- application of the tool which are relevant to a make rule
+    , results             :: [String]
+      -- | if true, the files are moved to the base directory, otherwise
+      -- they are left where they are
+    , moveresults         :: Bool
+    }
+
+
+mapEmpty :: a -> String
+mapEmpty _ = ""
+
+-- Instances of makefile details.
+jflexmakedetails, jlexmakedetails :: MakeFileDetails
+cupmakedetails :: RecordPositions -> MakeFileDetails
+
+jlexmakedetails = MakeDetails
+    { executable          = runJava "JLex.Main"
+    , flags               = mapEmpty
+    , filename            = "Yylex"
+    , fileextension       = ""
+    , toolname            = "JLex"
+    , toolversion         = "1.2.6."
+    , supportsEntryPoints = False
+    , results             = ["Yylex"]
+    , moveresults         = False
+    }
+
+jflexmakedetails = jlexmakedetails
+    { executable  = "jflex"
+    , toolname    = "JFlex"
+    , toolversion = "1.4.3"
+    }
+
+cupmakedetails rp = MakeDetails
+    { executable          = runJava "java_cup.Main"
+    , flags               = const (lnFlags ++ " -expect 100")
+    , filename            = "_cup"
+    , fileextension       = "cup"
+    , toolname            = "CUP"
+    , toolversion         = "0.10k"
+    , supportsEntryPoints = False
+    , results             = ["parser", "sym"]
+    , moveresults         = True
+    }
+  where
+    lnFlags = if rp == RecordPositions then "-locations" else "-nopositions"
+
+
+antlrmakedetails :: String -> MakeFileDetails
+antlrmakedetails l = MakeDetails
+    { executable = runJava "org.antlr.v4.Tool"
+    , flags               = \x -> unwords $
+                                    let path    = take (length x - 1) x
+                                        pointed = map cnv path
+                                        cnv y   = if isPathSeparator y
+                                                        then '.'
+                                                        else y
+                                        in [ "-lib", path
+                                           , "-package", pointed]
+    , filename            = l
+    , fileextension       = "g4"
+    , toolname            = "ANTLRv4"
+    , toolversion         = "4.5.1"
+    , supportsEntryPoints = True
+    , results             = [l]
+    , moveresults         = False
+    }
+
+prependPath , appendExtension :: String -> [String] -> [String]
+prependPath s fi     = [ s ++ x  | x <- fi ]
+appendExtension s fi = [ x +.+ s | x <- fi ]
+
+dotJava,dotClass :: [String] -> [String]
+dotJava  = appendExtension "java"
+dotClass = appendExtension "class"
+
+type CFToJava = String -> String -> CF -> String
+
+-- | Contains the pairs filename/content for all the non-abstract syntax files
+-- generated by BNFC.
+data BNFCGeneratedEntities = BNFCGenerated
+    { bprettyprinter :: (String, String)
+    , btest          :: (String, String)
+    , bcompos        :: (String, String)
+    , babstract      :: (String, String)
+    , bfold          :: (String, String)
+    , ball           :: (String, String)
+    , bskel          :: (String, String)
+    }
+
+bnfcVisitorsAndTests :: String   -> String    -> CF      ->
+                        CFToJava -> CFToJava -> CFToJava ->
+                        CFToJava -> CFToJava -> CFToJava ->
+                        CFToJava -> BNFCGeneratedEntities
+bnfcVisitorsAndTests pbase pabsyn cf cf0 cf1 cf2 cf3 cf4 cf5 cf6 =
+    BNFCGenerated
+    { bprettyprinter = ( "PrettyPrinter" , app cf0)
+    , bskel          = ( "VisitSkel", app cf1)
+    , bcompos        = ( "ComposVisitor" , app cf2)
+    , babstract      = ( "AbstractVisitor" , app cf3)
+    , bfold          = ( "FoldVisitor", app cf4)
+    , ball           = ( "AllVisitor", app cf5)
+    , btest          = ( "Test" , app cf6)
+    }
+  where app x = x pbase pabsyn cf
+
+inputfile x = filename x ++ case fileextension x of
+                                "" -> ""
+                                a -> '.':a
+
+-- |  constructs the rules regarding the parser in the makefile
+partialParserGoals :: String -> [String] -> [(String, [String])]
+partialParserGoals _ []          = []
+partialParserGoals dbas (x:rest) =
+    (dbas ++ x +.+ "class", map (\ y -> dbas ++ y +.+ "java") (x:rest))
+        : partialParserGoals dbas rest
+
+-- | Creates the Test.java class.
+javaTest :: [Doc]
+            -- ^ list of imported packages
+            -> String
+            -- ^ name of the exception thrown in case of parsing failure
+            -> (String -> [Doc])
+            -- ^ handler for the exception thrown
+            -> (Doc -> Doc -> Doc)
+            -- ^ function formulating the construction of the lexer object
+            -> (Doc -> Doc -> Doc)
+            -- ^ as above, for parser object
+            -> ([Cat] -> [Doc])
+            -- ^ Function processing the names of the methods corresponding
+            -- to entry points
+            -> (Doc -> Doc -> Doc -> Doc)
+            -- ^ function formulating the invocation of the parser tool within
+            -- Java
+            -> String
+            -- ^ error string output in consequence of a parsing failure
+            -> TestClass
+javaTest imports
+    err
+    errhand
+    lexerconstruction
+    parserconstruction
+    showOpts
+    invocation
+    errmsg
+    lexer
+    parser
+    packageBase
+    packageAbsyn
+    cf =
+    render $ vcat $
+        [ "package" <+> text packageBase <> ";"
+        , "import" <+> text packageBase <> ".*;"
+        , "import" <+> text packageAbsyn <> ".*;"
+        , "import java.io.*;"
+        ]
+        ++ map importfun imports
+        ++ errhand err
+        ++[ ""
+        , "public class Test"
         , codeblock 2
-            [ "Yylex l = null;"
-            , "parser p;"
-            , "try"
+            [ lx <+> "l;"
+            , px <+> "p;"
+            , ""
+            , "public Test(String[] args)"
+            , codeblock 2 [
+                "try"
+                , codeblock 2 [ "Reader input;"
+                    , "if (args.length == 0)"
+                       <> "input = new InputStreamReader(System.in);"
+                    , "else input = new FileReader(args[0]);"
+                    , "l = new "<>lexerconstruction lx "(input)"
+                    ]
+                , "catch(IOException e)"
+                , codeblock 2 [ "System.err.println"
+                        <>"(\"Error: File not found: \" + args[0]);"
+                    , "System.exit(1);"
+                    ]
+                , "p = new "<> parserconstruction px "l"
+                ]
+            , ""
+            , "public" <+> text packageAbsyn <> "." <> absentity
+                <+>"parse() throws Exception"
             , codeblock 2
-                [ "if (args.length == 0) l = new Yylex(new InputStreamReader(System.in));"
-                , "else l = new Yylex(new FileReader(args[0]));" ]
-            , "catch(FileNotFoundException e)"
-            , "{"
-            , " System.err.println(\"Error: File not found: \" + args[0]);"
-            , " System.exit(1);"
-            , "}"
-            , "p = new parser(l);"
-            , "/* The default parser is the first-defined entry point. */"
-            , "/* You may want to change this. Other options are: */"
-            , "/* " <> fsep (punctuate "," (showOpts (tail eps))) <> " */"
-            , "try"
-            , "{"
-            , "  " <> text packageAbsyn <> "." <> text (show def) <+> "parse_tree = p.p"
-             <> text (show def) <> "();"
-            , "  System.out.println();"
-            , "  System.out.println(\"Parse Succesful!\");"
-            , "  System.out.println();"
-            , "  System.out.println(\"[Abstract Syntax]\");"
-            , "  System.out.println();"
-            , "  System.out.println(PrettyPrinter.show(parse_tree));"
-            , "  System.out.println();"
-            , "  System.out.println(\"[Linearized Tree]\");"
-            , "  System.out.println();"
-            , "  System.out.println(PrettyPrinter.print(parse_tree));"
-            , "}"
-            , "catch(Throwable e)"
-            , "{"
-            , "  System.err.println(\"At line \" + String.valueOf(l.line_num()) + \", near \\\"\" + l.buff() + \"\\\" :\");"
-            , "  System.err.println(\"     \" + e.getMessage());"
-            , "  System.exit(1);"
-            , "}"
+                [ "/* The default parser is the first-defined entry point. */"
+                , "/* Other options are: */"
+                , "/* " <> fsep (punctuate "," (showOpts (tail eps))) <> " */"
+                , invocation px (text packageAbsyn) absentity
+                , printOuts [ "\"Parse Succesful!\""
+                    , "\"[Abstract Syntax]\""
+                    , "PrettyPrinter.show(ast)"
+                    , "\"[Linearized Tree]\""
+                    , "PrettyPrinter.print(ast)"
+                    ]
+                , "return ast;"
+                ]
+            , ""
+            , "public static void main(String args[]) throws Exception"
+            , codeblock 2 [ "Test t = new Test(args);"
+                , "try"
+                , codeblock 2 [ "t.parse();" ]
+                ,"catch("<>text err<+>"e)"
+                , codeblock 2 [ "System.err.println(\""<>text errmsg<>"\");"
+                    , "System.err.println(\"     \" + e.getMessage());"
+                    , "System.exit(1);"
+                    ]
+                ]
             ]
         ]
+    where
+      printOuts x    = vcat $ map javaPrintOut (messages x)
+      messages x     = "" : intersperse "" x
+      javaPrintOut x = text $ "System.out.println(" ++ x ++ ");"
+      importfun x    = "import" <+> x <> ".*;"
+      lx             = text lexer
+      px             = text parser
+      absentity      = text $ show def
+      eps            = allEntryPoints cf
+      def            = head eps
+
+-- | Error handling in ANTLR.
+-- By default, ANTLR does not stop after any parsing error and attempts to go
+-- on, delivering what it has been able to parse.
+-- It does not throw any exception, unlike J(F)lex+CUP.
+-- The below code makes the test class behave as with J(F)lex+CUP.
+antlrErrorHandling :: String -> [Doc]
+antlrErrorHandling te =
+    [ "class"<+>tedoc<+>"extends RuntimeException"
+    , codeblock 2 [ "int line;"
+        , "int column;"
+        , "public"<+>tedoc<>"(String msg, int l, int c)"
+        , codeblock 2 [ "super(msg);"
+            , "line = l;"
+            , "column = c;"
+            ]
+        ]
+    , "class BNFCErrorListener implements ANTLRErrorListener"
+    , codeblock 2 [ "@Override"
+        , "public void syntaxError(Recognizer<?, ?> recognizer, Object o, int i"
+            <> ", int i1, String s, RecognitionException e)"
+        , codeblock 2 [ "throw new"<+>tedoc<>"(s,i,i1);"]
+        , "@Override"
+        , "public void reportAmbiguity(Parser parser, DFA dfa, int i, int i1, "
+            <>"boolean b, BitSet bitSet, ATNConfigSet atnConfigSet)"
+        , codeblock 2[ "throw new"<+>tedoc<>"(\"Ambiguity at\",i,i1);" ]
+        , "@Override"
+        , "public void reportAttemptingFullContext(Parser parser, DFA dfa, "
+            <>"int i, int i1, BitSet bitSet, ATNConfigSet atnConfigSet)"
+        , codeblock 2 []
+        , "@Override"
+        ,"public void reportContextSensitivity(Parser parser, DFA dfa, int i, "
+            <>"int i1, int i2, ATNConfigSet atnConfigSet)"
+        ,codeblock 2 []
+        ]
     ]
-  where
-    eps = allEntryPoints cf
-    def = head eps
-    showOpts [] = []
-    showOpts (x:xs) | normCat x /= x = showOpts xs
-                    | otherwise      = text ('p' : identCat x) : showOpts xs
+    where tedoc = text te
diff --git a/src/BNFC/Backend/Java/CFtoAbstractVisitor.hs b/src/BNFC/Backend/Java/CFtoAbstractVisitor.hs
--- a/src/BNFC/Backend/Java/CFtoAbstractVisitor.hs
+++ b/src/BNFC/Backend/Java/CFtoAbstractVisitor.hs
@@ -15,7 +15,7 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 module BNFC.Backend.Java.CFtoAbstractVisitor (cf2AbstractVisitor) where
@@ -26,25 +26,26 @@
 
 cf2AbstractVisitor :: String -> String -> CF -> String
 cf2AbstractVisitor packageBase packageAbsyn cf =
-  unlines [
-      "package" +++ packageBase ++ ";",
-      "import" +++ packageAbsyn ++ ".*;",
-      "/** BNFC-Generated Abstract Visitor */",
-      "public class AbstractVisitor<R,A> implements AllVisitor<R,A> {",
-      concatMap (prData packageAbsyn user) groups,
-      "}"]
+    unlines [ "package" +++ packageBase ++ ";"
+    , "import" +++ packageAbsyn ++ ".*;"
+    , "/** BNFC-Generated Abstract Visitor */"
+    , "public class AbstractVisitor<R,A> implements AllVisitor<R,A> {"
+    , concatMap (prData packageAbsyn user) groups
+    , "}"]
   where
     user = fst (unzip (tokenPragmas cf))
-    groups = [ g | g@(c,_) <- fixCoercions (ruleGroupsInternals cf), not (isList c) ]
+    groups = [ g
+      | g@(c,_) <- fixCoercions (ruleGroupsInternals cf), not (isList c) ]
 
 --Traverses a category based on its type.
 prData :: String -> [UserDef] -> (Cat, [Rule]) -> String
 prData packageAbsyn user (cat, rules) =
     unlines $ ["/* " ++ identCat cat ++ " */"]
-              ++ map (prRule packageAbsyn user cat) rules
-              ++ ["    public R visitDefault(" ++ q ++ " p, A arg) {",
-                  "      throw new IllegalArgumentException(this.getClass().getName() + \": \" + p);",
-                  "    }"]
+      ++ map (prRule packageAbsyn user cat) rules
+      ++ ["    public R visitDefault(" ++ q ++ " p, A arg) {"
+         , "      throw new IllegalArgumentException(this.getClass()"
+            ++ ".getName() + \": \" + p);"
+         , "    }"]
   where q = packageAbsyn ++ "." ++ identCat cat
 
 --traverses a standard rule.
@@ -52,6 +53,5 @@
 prRule packageAbsyn _ _ (Rule fun _ _)
     | not (isCoercion fun || isDefinedRule fun) =
    "    public R visit(" ++ cls ++ " p, A arg) { return visitDefault(p, arg); }"
-   where cls = packageAbsyn ++ "." ++ fun
+  where cls = packageAbsyn ++ "." ++ fun
 prRule  _ _ _ _ = ""
-
diff --git a/src/BNFC/Backend/Java/CFtoAllVisitor.hs b/src/BNFC/Backend/Java/CFtoAllVisitor.hs
--- a/src/BNFC/Backend/Java/CFtoAllVisitor.hs
+++ b/src/BNFC/Backend/Java/CFtoAllVisitor.hs
@@ -15,16 +15,17 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 module BNFC.Backend.Java.CFtoAllVisitor (cf2AllVisitor) where
 
+import Data.List
 import BNFC.CF
 import BNFC.Utils ((+++))
 import BNFC.Backend.Common.NamedVariables
-import Data.List
 
+
 cf2AllVisitor :: String -> String -> CF -> String
 cf2AllVisitor packageBase packageAbsyn cf =
   unlines [
@@ -37,8 +38,9 @@
            intercalate ",\n" $ map ("  "++) is,
            "{}"]
   where
-    groups = [ g | g@(c,_) <- fixCoercions (ruleGroupsInternals cf), not (isList c) ]
-    is = map (prInterface packageAbsyn) groups
+    groups = [ g
+        | g@(c,_) <- fixCoercions (ruleGroupsInternals cf), not (isList c) ]
+    is     = map (prInterface packageAbsyn) groups
 
 prInterface :: String -> (Cat, [Rule]) -> String
 prInterface packageAbsyn (cat, _) =
diff --git a/src/BNFC/Backend/Java/CFtoAntlr4Lexer.hs b/src/BNFC/Backend/Java/CFtoAntlr4Lexer.hs
new file mode 100644
--- /dev/null
+++ b/src/BNFC/Backend/Java/CFtoAntlr4Lexer.hs
@@ -0,0 +1,204 @@
+{-# LANGUAGE NoImplicitPrelude #-}
+
+{-
+    BNF Converter: Java Antlr4 Lexer generator
+    Copyright (C) 2015  Author:  Gabriele Paganelli
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
+-}
+
+{-
+   **************************************************************
+    BNF Converter Module
+
+    Description   : This module generates the Antlr4 input file.
+                    Based on CFtoJLex15.hs
+
+    Author        : Gabriele Paganelli (gapag@distruzione.org)
+
+    License       : GPL (GNU General Public License)
+
+    Created       : 15 Oct, 2015
+
+    Modified      :
+
+
+   **************************************************************
+-}
+
+module BNFC.Backend.Java.CFtoAntlr4Lexer ( cf2AntlrLex ) where
+
+import Prelude'
+
+import Text.PrettyPrint
+import BNFC.CF
+import BNFC.Backend.Java.RegToAntlrLexer
+import BNFC.Backend.Java.Utils
+import BNFC.Backend.Common.NamedVariables
+
+-- | Creates a lexer grammar.
+-- Since antlr token identifiers must start with an uppercase symbol,
+-- I prepend "Surrogate_id_SYMB_" to the identifier.
+-- This introduces risks of clashes if somebody uses the same identifier for
+-- user defined tokens. This is not handled.
+-- returns the environment because the parser uses it.
+cf2AntlrLex :: String -> CF -> (Doc, SymEnv)
+cf2AntlrLex packageBase cf = (vcat
+    [ prelude packageBase
+    , cMacros
+    -- unnamed symbols (those in quotes, not in token definitions)
+    , lexSymbols env
+    , restOfLexerGrammar cf
+    ], env)
+  where
+    env                    = makeSymEnv (cfgSymbols cf ++ reservedWords cf)
+        (0 :: Int)
+    makeSymEnv [] _        = []
+    makeSymEnv (s:symbs) n = (s, "Surrogate_id_SYMB_" ++ show n)
+        : makeSymEnv symbs (n+1)
+
+
+-- | File prelude
+prelude ::  String -> Doc
+prelude packageBase = vcat
+    [ "// This Antlr4 file was machine-generated by the BNF converter"
+    , "lexer grammar" <+> text name <> "Lexer;"
+    ]
+    where name = getLastInPackage packageBase
+
+--For now all categories are included.
+--Optimally only the ones that are used should be generated.
+cMacros :: Doc
+cMacros = vcat
+    [ "// Predefined regular expressions in BNFC"
+    , frg "LETTER  : CAPITAL | SMALL"
+    , frg "CAPITAL : [A-Z\\u00C0-\\u00D6\\u00D8-\\u00DE]"
+    , frg "SMALL   : [a-z\\u00DF-\\u00F6\\u00F8-\\u00FF]"
+    , frg "DIGIT   : [0-9]"
+    ]
+  where frg a = "fragment" <+> a <+> ";"
+
+escapeChars :: String -> String
+escapeChars = concatMap escapeChar
+
+-- |
+-- >>> lexSymbols [("foo","bar")]
+-- bar : 'foo' ;
+-- >>> lexSymbols [("\\","bar")]
+-- bar : '\\' ;
+-- >>> lexSymbols [("/","bar")]
+-- bar : '/' ;
+-- >>> lexSymbols [("~","bar")]
+-- bar : '~' ;
+lexSymbols :: SymEnv -> Doc
+lexSymbols ss = vcat $  map transSym ss
+  where
+    transSym (s,r) = text r <>  " : '" <> text (escapeChars s) <> "' ;"
+
+-- | Writes rules for user defined tokens, and, if used, the predefined BNFC tokens.
+restOfLexerGrammar :: CF -> Doc
+restOfLexerGrammar cf = vcat
+    [ lexComments (comments cf)
+    , ""
+    , userDefTokens
+    , ifString strdec
+    , ifChar chardec
+    , ifC catDouble [
+        "// Double predefined token type",
+        "DOUBLE : DIGIT+ '.' DIGIT+ ('e' '-'? DIGIT+)?;"
+        ]
+    , ifC catInteger [
+        "//Integer predefined token type",
+        "INTEGER : DIGIT+;"
+        ]
+    , ifC catIdent [
+        "// Identifier token type" ,
+        "fragment" ,
+        "IDENTIFIER_FIRST : LETTER | '_';",
+        "IDENT : IDENTIFIER_FIRST (IDENTIFIER_FIRST | DIGIT)*;"
+        ]
+    , "// Whitespace"
+    , "WS : (' ' | '\\r' | '\\t' | '\\n')+ ->  skip;"
+    , "// Escapable sequences"
+    , "fragment"
+    , "Escapable : ('\"' | '\\\\' | 'n' | 't' | 'r');"
+    , "ErrorToken : . ;"
+    , ifString stringmodes
+    , ifChar charmodes
+    ]
+  where
+    ifC cat s     = if isUsedCat cf cat then vcat s else ""
+    ifString      = ifC catString
+    ifChar        = ifC catChar
+    strdec        = [ "// String token type"
+                    , "STRING : '\"' -> more, mode(STRINGMODE);"
+                    ]
+    chardec       = ["CHAR : '\\''   -> more, mode(CHARMODE);"]
+    userDefTokens = vcat
+        [ text (show name) <>" : " <> text (printRegJLex exp) <> ";"
+        | (name, exp) <- tokenPragmas cf ]
+    stringmodes   = [ "mode STRESCAPE;"
+        , "STRESCAPED : Escapable  -> more, popMode ;"
+        , "mode STRINGMODE;"
+        , "STRINGESC : '\\\\' -> more , pushMode(STRESCAPE);"
+        , "STRINGEND : '\"' ->  type(STRING), mode(DEFAULT_MODE);"
+        , "STRINGTEXT : ~[\\\"\\\\] -> more;"
+        ]
+    charmodes     = [ "mode CHARMODE;"
+        , "CHARANY     :  ~[\\'\\\\] -> more, mode(CHAREND);"
+        , "CHARESC     :  '\\\\'  -> more, pushMode(CHAREND),pushMode(ESCAPE);"
+        , "mode ESCAPE;"
+        , "ESCAPED : (Escapable | '\\'')  -> more, popMode ;"
+        , "mode CHAREND;"
+        , "CHARENDC     :  '\\''  -> type(CHAR), mode(DEFAULT_MODE);"
+        ]
+
+lexComments :: ([(String, String)], [String]) -> Doc
+lexComments ([],[]) = ""
+lexComments (m,s) = vcat
+    (prod "COMMENT_antlr_builtin" lexSingleComment s ++
+         prod "MULTICOMMENT_antlr_builtin" lexMultiComment m )
+
+  where
+    prod bg lc ty = [bg, ": ("] ++ punctuate "|" (map lc ty) ++ skiplex
+    skiplex       = [") -> skip;"]
+
+-- | Create lexer rule for single-line comments.
+--
+-- >>> lexSingleComment "--"
+-- '--' ~[\r\n]* (('\r'? '\n')|EOF)
+--
+-- >>> lexSingleComment "\""
+-- '"' ~[\r\n]* (('\r'? '\n')|EOF)
+lexSingleComment :: String -> Doc
+lexSingleComment c =
+    "'" <>text (escapeChars c) <>  "' ~[\\r\\n]* (('\\r'? '\\n')|EOF)"
+
+-- | Create lexer rule for multi-lines comments.
+--
+-- There might be a possible bug here if a language includes 2 multi-line
+-- comments. They could possibly start a comment with one character and end it
+-- with another. However this seems rare.
+--
+-- >>> lexMultiComment ("{-", "-}")
+-- '{-' (.)*? '-}'
+--
+-- >>> lexMultiComment ("\"'", "'\"")
+-- '"\'' (.)*? '\'"'
+lexMultiComment :: (String, String) -> Doc
+lexMultiComment (b,e) =
+         "'" <> text (escapeChars b)
+        <>"' (.)*? '"<> text (escapeChars e)
+        <> "'"
diff --git a/src/BNFC/Backend/Java/CFtoAntlr4Parser.hs b/src/BNFC/Backend/Java/CFtoAntlr4Parser.hs
new file mode 100644
--- /dev/null
+++ b/src/BNFC/Backend/Java/CFtoAntlr4Parser.hs
@@ -0,0 +1,205 @@
+{-
+    BNF Converter: Antlr4 Java 1.8 Generator
+    Copyright (C) 2004  Author:  Markus Forsberg, Michael Pellauer,
+                                 Bjorn Bringert
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
+-}
+
+{-
+   **************************************************************
+    BNF Converter Module
+
+    Description   : This module generates the ANTLR .g4 input file. It
+                    follows the same basic structure of CFtoHappy.
+
+    Author        : Gabriele Paganelli (gapag@distruzione.org),
+
+
+    License       : GPL (GNU General Public License)
+
+    Created       : 15 Oct, 2015
+
+    Modified      :
+
+
+   **************************************************************
+-}
+module BNFC.Backend.Java.CFtoAntlr4Parser ( cf2AntlrParse ) where
+
+import Data.List
+import BNFC.CF
+import BNFC.Backend.Java.Utils
+import BNFC.Backend.Common.NamedVariables
+import BNFC.Options (RecordPositions(..))
+import BNFC.Utils ( (+++), (+.+))
+
+-- Type declarations
+type Rules       = [(NonTerminal,[(Pattern, Fun, Action)])]
+type Pattern     = String
+type Action      = String
+type MetaVar     = (String, Cat)
+
+-- | Creates the ANTLR parser grammar for this CF.
+--The environment comes from CFtoAntlr4Lexer
+cf2AntlrParse :: String -> String -> CF -> RecordPositions -> SymEnv -> String
+cf2AntlrParse packageBase packageAbsyn cf _ env = unlines
+    [ header
+    , tokens
+    , prRules packageAbsyn (rulesForAntlr4 packageAbsyn cf env)
+    ]
+  where
+    header :: String
+    header = unlines
+        [ "// -*- Java -*- This ANTLRv4 file was machine-generated by BNFC"
+        , "parser grammar" +++ identifier ++ "Parser;"
+        ]
+    tokens :: String
+    tokens = unlines
+        [ "options {"
+        , "  tokenVocab = "++identifier++"Lexer;"
+        , "}"
+        ]
+    identifier = getLastInPackage packageBase
+
+--The following functions are a (relatively) straightforward translation
+--of the ones in CFtoHappy.hs
+rulesForAntlr4 :: String -> CF -> SymEnv -> Rules
+rulesForAntlr4 packageAbsyn cf env = map mkOne getrules
+  where
+    getrules          = ruleGroups cf
+    mkOne (cat,rules) = constructRule packageAbsyn cf env rules cat
+
+-- | For every non-terminal, we construct a set of rules. A rule is a sequence of
+-- terminals and non-terminals, and an action to be performed.
+constructRule :: String -> CF -> SymEnv -> [Rule] -> NonTerminal -> (NonTerminal,[(Pattern, Fun, Action)])
+constructRule packageAbsyn cf env rules nt =
+    (nt, [ (p , funRule r , generateAction packageAbsyn nt (funRule r) (revM b m) b)
+          | (index ,r0) <- zip [1..(length rules)] rules,
+          let (b,r) = if isConsFun (funRule r0) && elem (valCat r0) revs
+                          then (True, revSepListRule r0)
+                          else (False, r0)
+              (p,m) = generatePatterns index env r])
+ where
+   revM False = id
+   revM True  = reverse
+   revs       = cfgReversibleCats cf
+
+-- Generates a string containing the semantic action.
+generateAction :: String -> NonTerminal -> Fun -> [MetaVar]
+               -> Bool   -- ^ Whether the list should be reversed or not.
+                         --   Only used if this is a list rule.
+               -> Action
+generateAction packageAbsyn nt f ms rev
+    | isNilFun f = "$result = new " ++ c ++ "();"
+    | isOneFun f = "$result = new " ++ c ++ "(); $result.addLast("
+        ++ p_1 ++ ");"
+    | isConsFun f = "$result = " ++ p_2 ++ "; "
+                           ++ "$result." ++ add ++ "(" ++ p_1 ++ ");"
+    | isCoercion f = "$result = " ++  p_1 ++ ";"
+    | isDefinedRule f = "$result = parser." ++ f ++ "_"
+                        ++ "(" ++ intercalate "," (map resultvalue ms) ++ ");"
+    | otherwise = "$result = new " ++ c
+                  ++ "(" ++ intercalate "," (map resultvalue ms) ++ ");"
+   where
+     c                 = packageAbsyn ++ "." ++
+                            if isNilFun f || isOneFun f || isConsFun f
+                            then identCat (normCat nt) else f
+     p_1               = resultvalue $ ms!!0
+     p_2               = resultvalue $ ms!!1
+     add               = if rev then "addLast" else "addFirst"
+     gettext           = "getText()"
+     removeQuotes x    = "substring(1, "++ x +.+ gettext +.+ "length()-1)"
+     parseint x        = "Integer.parseInt("++x++")"
+     parsedouble x     = "Double.parseDouble("++x++")"
+     charat            = "charAt(1)"
+     resultvalue (n,c) = case c of
+                          TokenCat "Ident"   -> n'+.+gettext
+                          TokenCat "Integer" -> parseint $ n'+.+gettext
+                          TokenCat "Char"    -> n'+.+gettext+.+charat
+                          TokenCat "Double"  -> parsedouble $ n'+.+gettext
+                          TokenCat "String"  -> n'+.+gettext+.+removeQuotes n'
+                          _         -> (+.+) n' (if isTokenCat c then gettext else "result")
+                          where n' = '$':n
+
+-- | Generate patterns and a set of metavariables indicating
+-- where in the pattern the non-terminal
+-- >>> generatePatterns 2 [] (Rule "myfun" (Cat "A") [])
+-- (" /* empty */ ",[])
+-- >>> generatePatterns 3 [("def", "_SYMB_1")] (Rule "myfun" (Cat "A") [Right "def", Left (Cat "B")])
+-- ("_SYMB_1 p_3_2=b ",[("p_3_2",B)])
+generatePatterns :: Int -> SymEnv -> Rule -> (Pattern,[MetaVar])
+generatePatterns ind env r = case rhsRule r of
+    []  -> (" /* empty */ ",[])
+    its -> (mkIt 1 its, metas its)
+ where
+    mkIt _ [] = []
+    mkIt n (i:is) = case i of
+        Left c -> "p_" ++show ind++"_"++ show (n :: Int) ++ "="++ c'
+            +++ mkIt (n+1) is
+          where
+              c' = case c of
+                  TokenCat "Ident"   -> "IDENT"
+                  TokenCat "Integer" -> "INTEGER"
+                  TokenCat "Char"    -> "CHAR"
+                  TokenCat "Double"  -> "DOUBLE"
+                  TokenCat "String"  -> "STRING"
+                  _                  -> if isTokenCat c
+                                          then identCat c
+                                          else firstLowerCase
+                                                (getRuleName (identCat c))
+        Right s -> case lookup s env of
+            (Just x) -> x +++ mkIt (n+1) is
+            (Nothing) -> mkIt n is
+    metas its = [("p_" ++ show ind ++"_"++ show i, category)
+                    | (i,Left category) <- zip [1 :: Int ..] its]
+
+-- | Puts together the pattern and actions and returns a string containing all
+-- the rules.
+prRules :: String -> Rules -> String
+prRules _ [] = []
+prRules packabs ((_, []):rs) = prRules packabs rs
+prRules packabs ((nt,(p, fun, a):ls):rs) =
+    preamble ++ ";\n" ++ prRules packabs rs
+  where
+    preamble          = unwords [ nt'
+                        , "returns"
+                        , "["
+                        , packabs+.+normcat
+                        , "result"
+                        , "]"
+                        , ":"
+                        , p
+                        , "{"
+                        , a
+                        , "}"
+                        , "#"
+                        , antlrRuleLabel fun
+                        , '\n' : pr ls
+                        ]
+    alternative (p',fun',a')
+                      = unwords ["  |", p', "{", a' , "}", "#"
+                        , antlrRuleLabel fun']
+    catid             = identCat nt
+    normcat           = identCat (normCat nt)
+    nt'               = getRuleName $ firstLowerCase catid
+    pr []             = []
+    pr (k:ls) = unlines [alternative k] ++ pr ls
+    antlrRuleLabel fnc
+      | isNilFun fnc   = catid ++ "_Empty"
+      | isOneFun fnc   = catid ++ "_AppendLast"
+      | isConsFun fnc  = catid ++ "_PrependFirst"
+      | isCoercion fnc = "Coercion_" ++ catid
+      | otherwise      = getLabelName fnc
diff --git a/src/BNFC/Backend/Java/CFtoComposVisitor.hs b/src/BNFC/Backend/Java/CFtoComposVisitor.hs
--- a/src/BNFC/Backend/Java/CFtoComposVisitor.hs
+++ b/src/BNFC/Backend/Java/CFtoComposVisitor.hs
@@ -1,3 +1,5 @@
+{-# LANGUAGE NoImplicitPrelude #-}
+
 {-
     BNF Converter: Java 1.5 Compositional Vistor generator
     Copyright (C) 2006 Bjorn Bringert
@@ -15,17 +17,19 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 module BNFC.Backend.Java.CFtoComposVisitor (cf2ComposVisitor) where
 
+import Prelude'
+
+import Data.List
+import Data.Either (lefts)
 import BNFC.CF
 import BNFC.Backend.Java.CFtoJavaAbs15 (typename)
 import BNFC.Utils ((+++))
 import BNFC.Backend.Common.NamedVariables
-import Data.List
-import Data.Either (lefts)
 import BNFC.PrettyPrint
 
 cf2ComposVisitor :: String -> String -> CF -> String
@@ -35,18 +39,22 @@
     concatMap (prData packageAbsyn user) groups,
     "}"]
   where
-    user = fst (unzip (tokenPragmas cf))
-    groups = [ g | g@(c,_) <- fixCoercions (ruleGroupsInternals cf), not (isList c) ]
-    is = map (prInterface packageAbsyn) groups
-    header = unlines [
-      "package" +++ packageBase ++ ";",
-      "import" +++ packageAbsyn ++ ".*;",
-      "/** BNFC-Generated Composition Visitor",
-      "*/",
-      "",
-      "public class ComposVisitor<A> implements",
-      concat $ intersperse ",\n" $ map ("  "++) is,
-      "{"
+    user   = fst (unzip (tokenPragmas cf))
+    groups =
+        [ g
+        | g@(c,_) <- fixCoercions (ruleGroupsInternals cf)
+        , not (isList c)
+        ]
+    is     = map (prInterface packageAbsyn) groups
+    header = unlines
+      [ "package" +++ packageBase ++ ";"
+      , "import" +++ packageAbsyn ++ ".*;"
+      , "/** BNFC-Generated Composition Visitor"
+      , "*/"
+      , ""
+      , "public class ComposVisitor<A> implements"
+      , intercalate ",\n" $ map ("  "++) is
+      , "{"
       ]
 
 
@@ -55,14 +63,16 @@
     q ++ ".Visitor<" ++ q ++ ",A>"
   where q = packageAbsyn ++ "." ++ identCat cat
 
---Traverses a category based on its type.
+-- | Traverses a category based on its type.
+
 prData :: String -> [UserDef] -> (Cat, [Rule]) -> String
-prData packageAbsyn user (cat, rules) =
-    unlines [
-             "/* " ++ identCat cat ++ " */",
-	     concatMap (render . prRule packageAbsyn user cat) rules
-	    ]
--- | traverses a standard rule.
+prData packageAbsyn user (cat, rules) = unlines
+    [ "/* " ++ identCat cat ++ " */"
+    , concatMap (render . prRule packageAbsyn user cat) rules
+    ]
+
+-- | Traverses a standard rule.
+--
 -- >>> prRule "lang.absyn" [Cat "A"] (Cat "B") (Rule "F" (Cat "B") [Left (Cat "A"), Right "+", Left (ListCat (Cat "B"))])
 --     public B visit(lang.absyn.F p, A arg)
 --     {
@@ -74,6 +84,7 @@
 --       }
 --       return new lang.absyn.F(a_, listb_);
 --     }
+
 prRule :: String -> [UserDef] -> Cat -> Rule -> Doc
 prRule packageAbsyn user cat (Rule fun _ cats)
   | not (isCoercion fun || isDefinedRule fun) = nest 4 $ vcat
@@ -88,18 +99,23 @@
 prRule  _ _ _ _ = ""
 
 -- | Traverses a class's instance variables.
+--
 -- >>> prCat [Cat "A"] (Cat "A", "a_")
 -- String a_ = p.a_;
+--
 -- >>> prCat [] (ListCat (Cat "Integer"), "listinteger_")
 -- ListInteger listinteger_ = p.listinteger_;
+--
 -- >>> prCat [] (ListCat (Cat "N"), "listn_")
 -- ListN listn_ = new ListN();
 -- for (N x : p.listn_)
 -- {
 --   listn_.add(x.accept(this,arg));
 -- }
+--
 -- >>> prCat [] (Cat "N", "n_")
 -- N n_ = p.n_.accept(this, arg);
+
 prCat :: [UserDef]  -- ^ User defined token categories
       -> (Cat, Doc) -- ^ Variable category and names
       -> Doc        -- ^ Code for visiting the variable
@@ -110,12 +126,13 @@
               $$ codeblock 2 [ nt <> ".add(x.accept(this,arg));" ]
   | otherwise = decl (var <> ".accept(this, arg)")
   where
-      var = "p." <> nt
-      varType = typename (identCat (normCat cat)) user
-      et = typename (show$normCatOfList cat) user
-      decl v = text varType <+> nt <+> "=" <+> v <> ";"
+    var     = "p." <> nt
+    varType = typename (identCat (normCat cat)) user
+    et      = typename (identCat (normCatOfList cat)) user
+    decl v  = text varType <+> nt <+> "=" <+> v <> ";"
 
---Just checks if something is a basic or user-defined type.
-isBasicType :: [UserDef] -> String -> Bool
-isBasicType user v = v `elem` (map show user ++ ["Integer","Character","String","Double"])
+-- | Just checks if something is a basic or user-defined type.
 
+isBasicType :: [UserDef] -> String -> Bool
+isBasicType user v =
+    v `elem` (map show user ++ ["Integer","Character","String","Double"])
diff --git a/src/BNFC/Backend/Java/CFtoCup15.hs b/src/BNFC/Backend/Java/CFtoCup15.hs
--- a/src/BNFC/Backend/Java/CFtoCup15.hs
+++ b/src/BNFC/Backend/Java/CFtoCup15.hs
@@ -15,7 +15,7 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 {-
@@ -42,6 +42,7 @@
 import BNFC.CF
 import Data.List
 import BNFC.Backend.Common.NamedVariables
+import BNFC.Options (RecordPositions(..))
 import BNFC.Utils ( (+++) )
 import BNFC.TypeChecker  -- We need to (re-)typecheck to figure out list instances in
                     -- defined rules.
@@ -49,95 +50,110 @@
 
 import Data.Char
 
--- Type declarations
-type Rules       = [(NonTerminal,[(Pattern,Action)])]
-type Pattern     = String
-type Action      = String
-type MetaVar     = String
+type Rules   = [(NonTerminal,[(Pattern,Action)])]
+type Pattern = String
+type Action  = String
+type MetaVar = String
 
 --The environment comes from the CFtoJLex
-cf2Cup :: String -> String -> CF -> SymEnv -> String
-cf2Cup packageBase packageAbsyn cf env = unlines
-    [
-     header,
-     declarations packageAbsyn (allCats cf),
-     tokens env,
-     specialToks cf,
-     specialRules cf,
-     prEntryPoint cf,
-     prRules (rulesForCup packageAbsyn cf env)
+cf2Cup :: String -> String -> CF -> RecordPositions -> SymEnv -> String
+cf2Cup packageBase packageAbsyn cf rp env = unlines
+    [ header
+    , declarations packageAbsyn (allCats cf)
+    , tokens env
+    , specialToks cf
+    , specialRules cf
+    , prEntryPoint cf
+    , prRules (rulesForCup packageAbsyn cf rp env)
     ]
-    where
-      header :: String
-      header = unlines
-         ["// -*- Java -*- This Cup file was machine-generated by BNFC",
-          "package" +++ packageBase ++ ";",
-          "",
-          "parser code {:",
-          parseMethod packageAbsyn (firstEntry cf),
-          "public <B,A extends java.util.LinkedList<? super B>> A cons_(B x, A xs) { xs.addFirst(x); return xs; }",
-          definedRules packageAbsyn cf,
-          -- unlines $ map (parseMethod packageAbsyn) (allEntryPoints cf),
-          "public void syntax_error(java_cup.runtime.Symbol cur_token)",
-          "{",
-          "\treport_error(\"Syntax Error, trying to recover and continue parse...\", cur_token);",
-          "}",
-          "",
-          "public void unrecovered_syntax_error(java_cup.runtime.Symbol cur_token) throws java.lang.Exception",
-          "{",
-          "\tthrow new Exception(\"Unrecoverable Syntax Error\");",
-          "}",
-          "",
-          ":}"
-          ]
+  where
+    header :: String
+    header = unlines
+      [ "// -*- Java -*- This Cup file was machine-generated by BNFC"
+      , "package" +++ packageBase ++ ";"
+      , ""
+      , "action code {:"
+      , "public java_cup.runtime.ComplexSymbolFactory.Location getLeftLocation("
+      , "    java_cup.runtime.ComplexSymbolFactory.Location ... locations) {"
+      , "  for (java_cup.runtime.ComplexSymbolFactory.Location l : locations) {"
+      , "    if (l != null) {"
+      , "      return l;"
+      , "    }"
+      , "  }"
+      , "  return null;"
+      , "}"
+      , ":}"
+      , "parser code {:"
+      , parseMethod packageAbsyn (firstEntry cf)
+      , "public <B,A extends java.util.LinkedList<? super B>> "
+        ++ "A cons_(B x, A xs) { xs.addFirst(x); return xs; }"
+      , definedRules packageAbsyn cf
+      , "public void syntax_error(java_cup.runtime.Symbol cur_token)"
+      , "{"
+      , "  report_error(\"Syntax Error, trying to recover and continue"
+        ++ " parse...\", cur_token);"
+      , "}"
+      , ""
+      , "public void unrecovered_syntax_error(java_cup.runtime.Symbol "
+        ++ "cur_token) throws java.lang.Exception"
+      , "{"
+      , "  throw new Exception(\"Unrecoverable Syntax Error\");"
+      , "}"
+      , ""
+      , ":}"
+      ]
 
 definedRules :: String -> CF -> String
 definedRules packageAbsyn cf =
-        unlines [ rule f xs e | FunDef f xs e <- pragmasOfCF cf ]
-    where
-        ctx = buildContext cf
+    unlines [ rule f xs e | FunDef f xs e <- cfgPragmas cf ]
+  where
+    ctx = buildContext cf
 
-        list = LC (\t -> "List" ++ unBase t) (const "cons")
-            where
-                unBase (ListT t) = unBase t
-                unBase (BaseT x) = show$normCat$strToCat x
+    list = LC (\ t -> "List" ++ unBase t) (const "cons")
+      where
+         unBase (ListT t) = unBase t
+         unBase (BaseT x) = show $ normCat $ strToCat x
 
-        rule f xs e =
-            case checkDefinition' list ctx f xs e of
-                Bad err -> error $ "Panic! This should have been caught already:\n" ++ err
-                Ok (args,(e',t)) -> unlines
-                    [ "public " ++ javaType t ++ " " ++ f ++ "_ (" ++
-                        intercalate ", " (map javaArg args) ++ ") {"
-                    , "  return " ++ javaExp e' ++ ";"
-                    , "}"
-                    ]
-            where
+    rule f xs e =
+        case checkDefinition' list ctx f xs e of
+            Bad err          ->
+                error $ "Panic! This should have been caught already:\n"
+                    ++ err
+            Ok (args,(e',t)) -> unlines
+                [ "public " ++ javaType t ++ " " ++ f ++ "_ (" ++
+                    intercalate ", " (map javaArg args) ++ ") {"
+                , "  return " ++ javaExp e' ++ ";"
+                , "}"
+                ]
+     where
 
-                javaType :: Base -> String
-                javaType (ListT (BaseT x)) = packageAbsyn ++ ".List" ++ show (normCat$strToCat x)
-                javaType (ListT t)         = javaType t
-                javaType (BaseT x)
-                    | isToken x ctx = "String"
-                    | otherwise     = packageAbsyn ++ "." ++ show (normCat$strToCat x)
+       javaType :: Base -> String
+       javaType (ListT (BaseT x)) = packageAbsyn ++ ".List"
+                                   ++ show (normCat $ strToCat x)
+       javaType (ListT t)         = javaType t
+       javaType (BaseT x)
+           | isToken x ctx = "String"
+           | otherwise     = packageAbsyn ++ "."
+                           ++ show (normCat $ strToCat x)
 
-                javaArg :: (String, Base) -> String
-                javaArg (x,t) = javaType t ++ " " ++ x ++ "_"
+       javaArg :: (String, Base) -> String
+       javaArg (x,t) = javaType t ++ " " ++ x ++ "_"
 
-                javaExp :: Exp -> String
-                javaExp (App "null" []) = "null"
-                javaExp (App x [])
-                    | x `elem` xs       = x ++ "_"      -- argument
-                javaExp (App t [e])
-                    | isToken t ctx     = call "new String" [e]
-                javaExp (App x es)
-                    | isUpper (head x)  = call ("new " ++ packageAbsyn ++ "." ++ x) es
-                    | otherwise         = call (x ++ "_") es
-                javaExp (LitInt n)      = "new Integer(" ++ show n ++ ")"
-                javaExp (LitDouble x)   = "new Double(" ++ show x ++ ")"
-                javaExp (LitChar c)     = "new Character(" ++ show c ++ ")"
-                javaExp (LitString s)   = "new String(" ++ show s ++ ")"
+       javaExp :: Exp -> String
+       javaExp (App "null" []) = "null"
+       javaExp (App x [])
+           | x `elem` xs       = x ++ "_"      -- argument
+       javaExp (App t [e])
+           | isToken t ctx     = call "new String" [e]
+       javaExp (App x es)
+           | isUpper (head x)  = call ("new " ++ packageAbsyn ++ "." ++ x) es
+           | otherwise         = call (x ++ "_") es
+       javaExp (LitInt n)      = "new Integer(" ++ show n ++ ")"
+       javaExp (LitDouble x)   = "new Double(" ++ show x ++ ")"
+       javaExp (LitChar c)     = "new Character(" ++ show c ++ ")"
+       javaExp (LitString s)   = "new String(" ++ show s ++ ")"
 
-                call x es = x ++ "(" ++ intercalate ", " (map javaExp es) ++ ")"
+       call x es = x ++ "(" ++ intercalate ", " (map javaExp es) ++ ")"
 
 
 -- peteg: FIXME JavaCUP can only cope with one entry point AFAIK.
@@ -152,13 +168,12 @@
   if normCat cat /= cat
     then ""
     else unlines
-             [
-              "  public" +++ packageAbsyn ++ "." ++ cat' +++ "p" ++ cat' ++ "()"
-                ++ " throws Exception",
-              "  {",
-              "\tjava_cup.runtime.Symbol res = parse();",
-              "\treturn (" ++ packageAbsyn ++ "." ++ cat' ++ ") res.value;",
-              "  }"
+             [ "  public" +++ packageAbsyn ++ "." ++ cat' +++ "p" ++ cat' ++ "()"
+                 ++ " throws Exception"
+             , "  {"
+             , "    java_cup.runtime.Symbol res = parse();"
+             , "    return (" ++ packageAbsyn ++ "." ++ cat' ++ ") res.value;"
+             , "  }"
              ]
     where cat' = identCat (normCat cat)
 
@@ -176,33 +191,32 @@
   declTok (s,r) = "terminal" +++ r ++ ";    //   " ++ s
 
 specialToks :: CF -> String
-specialToks cf = unlines [
-  ifC catString "terminal String _STRING_;",
-  ifC catChar "terminal Character _CHAR_;",
-  ifC catInteger "terminal Integer _INTEGER_;",
-  ifC catDouble "terminal Double _DOUBLE_;",
-  ifC catIdent "terminal String _IDENT_;"
+specialToks cf = unlines
+  [ ifC catString  "terminal String _STRING_;"
+  , ifC catChar    "terminal Character _CHAR_;"
+  , ifC catInteger "terminal Integer _INTEGER_;"
+  , ifC catDouble  "terminal Double _DOUBLE_;"
+  , ifC catIdent   "terminal String _IDENT_;"
   ]
    where
     ifC cat s = if isUsedCat cf cat then s else ""
 
--- This handles user defined tokens
--- FIXME
 specialRules:: CF -> String
 specialRules cf =
     unlines ["terminal String " ++ name ++ ";" | name <- tokenNames cf]
 
 --The following functions are a (relatively) straightforward translation
 --of the ones in CFtoHappy.hs
-rulesForCup :: String -> CF -> SymEnv -> Rules
-rulesForCup packageAbsyn cf env = map mkOne $ ruleGroups cf where
-  mkOne (cat,rules) = constructRule packageAbsyn cf env rules cat
+rulesForCup :: String -> CF -> RecordPositions -> SymEnv -> Rules
+rulesForCup packageAbsyn cf rp env = map mkOne $ ruleGroups cf where
+  mkOne (cat,rules) = constructRule packageAbsyn cf rp env rules cat
 
 -- | For every non-terminal, we construct a set of rules. A rule is a sequence of
 -- terminals and non-terminals, and an action to be performed.
-constructRule :: String -> CF -> SymEnv -> [Rule] -> NonTerminal -> (NonTerminal,[(Pattern,Action)])
-constructRule packageAbsyn cf env rules nt =
-    (nt, [ (p, generateAction packageAbsyn nt (funRule r) (revM b m) b)
+constructRule :: String -> CF -> RecordPositions -> SymEnv -> [Rule] -> NonTerminal
+    -> (NonTerminal,[(Pattern,Action)])
+constructRule packageAbsyn cf rp env rules nt =
+    (nt, [ (p, generateAction packageAbsyn nt (funRule r) (revM b m) b rp)
           | r0 <- rules,
           let (b,r) = if isConsFun (funRule r0) && elem (valCat r0) revs
                           then (True, revSepListRule r0)
@@ -210,45 +224,70 @@
               (p,m) = generatePatterns env r])
  where
    revM False = id
-   revM True = reverse
-   revs = reversibleCats cf
+   revM True  = reverse
+   revs       = cfgReversibleCats cf
 
 -- Generates a string containing the semantic action.
 generateAction :: String -> NonTerminal -> Fun -> [MetaVar]
                -> Bool   -- ^ Whether the list should be reversed or not.
                          --   Only used if this is a list rule.
+               -> RecordPositions   -- ^ Record line and column info.
                -> Action
-generateAction packageAbsyn nt f ms rev
-    | isNilFun f = "RESULT = new " ++ c ++ "();"
-    | isOneFun f = "RESULT = new " ++ c ++ "(); RESULT.addLast(" ++ p_1 ++ ");"
-    | isConsFun f = "RESULT = " ++ p_2 ++ "; "
+generateAction packageAbsyn nt f ms rev rp
+    | isNilFun f      = "RESULT = new " ++ c ++ "();"
+    | isOneFun f      = "RESULT = new " ++ c ++ "(); RESULT.addLast("
+                           ++ p_1 ++ ");"
+    | isConsFun f     = "RESULT = " ++ p_2 ++ "; "
                            ++ p_2 ++ "." ++ add ++ "(" ++ p_1 ++ ");"
-    | isCoercion f = "RESULT = " ++ p_1 ++ ";"
+    | isCoercion f    = "RESULT = " ++ p_1 ++ ";"
     | isDefinedRule f = "RESULT = parser." ++ f ++ "_"
                         ++ "(" ++ intercalate "," ms ++ ");"
-    | otherwise = "RESULT = new " ++ c
-                  ++ "(" ++ intercalate "," ms ++ ");"
+    | otherwise       = "RESULT = new " ++ c
+                  ++ "(" ++ intercalate "," ms ++ ");" ++ lineInfo
    where
-     c = packageAbsyn ++ "." ++
+     c   = packageAbsyn ++ "." ++
            if isNilFun f || isOneFun f || isConsFun f
-            then identCat (normCat nt) else f
-     p_1 = ms!!0
-     p_2 = ms!!1
+             then identCat (normCat nt) else f
+     p_1 = ms !! 0
+     p_2 = ms !! 1
      add = if rev then "addLast" else "addFirst"
+     lineInfo =
+        if rp == RecordPositions
+          then case ms of
+            [] -> "\n((" ++ c ++ ")RESULT).line_num = -1;" ++
+                  "\n((" ++ c ++ ")RESULT).col_num = -1;" ++
+                  "\n((" ++ c ++ ")RESULT).offset = -1;"
+            _  -> "\njava_cup.runtime.ComplexSymbolFactory.Location leftLoc = getLeftLocation(" ++
+                  intercalate "," (map (++"xleft") ms) ++ ");" ++
+                  "\nif (leftLoc != null) {" ++
+                  "\n  ((" ++ c ++ ")RESULT).line_num = leftLoc.getLine();" ++
+                  "\n  ((" ++ c ++ ")RESULT).col_num = leftLoc.getColumn();" ++
+                  "\n  ((" ++ c ++ ")RESULT).offset = leftLoc.getOffset();" ++
+                  "\n} else {" ++
+                  "\n  ((" ++ c ++ ")RESULT).line_num = -1;" ++
+                  "\n  ((" ++ c ++ ")RESULT).col_num = -1;" ++
+                  "\n  ((" ++ c ++ ")RESULT).offset = -1;" ++
+                  "\n}"
+          else ""
 
+
 -- | Generate patterns and a set of metavariables indicating
--- where in the pattern the non-terminal
+-- where in the pattern the non-terminal.
+--
 -- >>> generatePatterns [] (Rule "myfun" (Cat "A") [])
 -- (" /* empty */ ",[])
+--
 -- >>> generatePatterns [("def", "_SYMB_1")] (Rule "myfun" (Cat "A") [Right "def", Left (Cat "B")])
--- ("_SYMB_1 B:p_2 ",["p_2"])
+-- ("_SYMB_1:p_1 B:p_2 ",["p_2"])
+
 generatePatterns :: SymEnv -> Rule -> (Pattern,[MetaVar])
 generatePatterns env r = case rhsRule r of
-    []  -> (" /* empty */ ",[])
+    []  -> (" /* empty */ ", [])
     its -> (mkIt 1 its, metas its)
  where
     mkIt _ [] = []
-    mkIt n (i:is) = case i of
+    mkIt n (i:is) =
+      case i of
         Left c -> c' ++ ":p_" ++ show (n :: Int) +++ mkIt (n+1) is
           where
               c' = case c of
@@ -257,21 +296,20 @@
                   TokenCat "Char"    -> "_CHAR_"
                   TokenCat "Double"  -> "_DOUBLE_"
                   TokenCat "String"  -> "_STRING_"
-                  _         -> identCat c
+                  _ -> identCat c
         Right s -> case lookup s env of
-            (Just x) -> x +++ mkIt (n+1) is
-            (Nothing) -> mkIt n is
+            Just x  -> (x ++ ":p_" ++ show (n :: Int)) +++ mkIt (n+1) is
+            Nothing -> mkIt n is
     metas its = ["p_" ++ show i | (i,Left _) <- zip [1 :: Int ..] its]
 
 -- We have now constructed the patterns and actions,
 -- so the only thing left is to merge them into one string.
 prRules :: Rules -> String
-prRules [] = []
-prRules ((_, []):rs) = prRules rs --internal rule
-prRules ((nt,(p,a):ls):rs) =
-  unwords [nt', "::=", p, "{:", a, ":}", '\n' : pr ls] ++ ";\n" ++ prRules rs
- where
-  nt' = identCat nt
-  pr []           = []
-  pr ((p,a):ls)   = unlines [unwords ["  |", p, "{:", a , ":}"]] ++ pr ls
-
+prRules []                    = []
+prRules ((_ , []      ) : rs) = prRules rs --internal rule
+prRules ((nt, (p,a):ls) : rs) =
+    unwords [ nt', "::=", p, "{:", a, ":}", '\n' : pr ls ] ++ ";\n" ++ prRules rs
+  where
+    nt' = identCat nt
+    pr []           = []
+    pr ((p,a):ls)   = unlines [ unwords [ "  |", p, "{:", a , ":}" ] ] ++ pr ls
diff --git a/src/BNFC/Backend/Java/CFtoFoldVisitor.hs b/src/BNFC/Backend/Java/CFtoFoldVisitor.hs
--- a/src/BNFC/Backend/Java/CFtoFoldVisitor.hs
+++ b/src/BNFC/Backend/Java/CFtoFoldVisitor.hs
@@ -1,3 +1,5 @@
+{-# LANGUAGE NoImplicitPrelude #-}
+
 {-
     BNF Converter: Java 1.5 Fold Vistor generator
     Copyright (C) 2006 Bjorn Bringert
@@ -15,11 +17,13 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 module BNFC.Backend.Java.CFtoFoldVisitor (cf2FoldVisitor) where
 
+import Prelude'
+
 import BNFC.CF
 import BNFC.Backend.Java.CFtoJavaAbs15 (typename)
 import BNFC.Utils ((+++))
@@ -50,11 +54,10 @@
 
 --Traverses a category based on its type.
 prData :: String -> [UserDef] -> (Cat, [Rule]) -> String
-prData packageAbsyn user (cat, rules) =
-    unlines [
-             "/* " ++ identCat cat ++ " */",
-	     concatMap (prRule packageAbsyn user cat) rules
-	    ]
+prData packageAbsyn user (cat, rules) = unlines
+    [ "/* " ++ identCat cat ++ " */"
+    , concatMap (prRule packageAbsyn user cat) rules
+    ]
 
 --traverses a standard rule.
 prRule :: String -> [UserDef] -> Cat -> Rule -> String
@@ -100,4 +103,3 @@
 --Just checks if something is a basic or user-defined type.
 isBasicType :: [UserDef] -> String -> Bool
 isBasicType user v = v `elem` (map show user ++ ["Integer","Character","String","Double"])
-
diff --git a/src/BNFC/Backend/Java/CFtoJLex15.hs b/src/BNFC/Backend/Java/CFtoJLex15.hs
--- a/src/BNFC/Backend/Java/CFtoJLex15.hs
+++ b/src/BNFC/Backend/Java/CFtoJLex15.hs
@@ -1,3 +1,5 @@
+{-# LANGUAGE NoImplicitPrelude #-}
+
 {-
     BNF Converter: Java JLex generator
     Copyright (C) 2004  Author:  Michael Pellauer
@@ -14,7 +16,7 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 {-
@@ -39,30 +41,32 @@
 
 module BNFC.Backend.Java.CFtoJLex15 ( cf2jlex ) where
 
+import Prelude'
+
 import BNFC.CF
-import BNFC.Backend.Java.RegToJLex
-import BNFC.Utils ( (+++) )
 import BNFC.Backend.Common.NamedVariables
+import BNFC.Backend.Java.RegToJLex
+import BNFC.Options (JavaLexerParser(..), RecordPositions(..))
+import BNFC.Utils (cstring)
 import Text.PrettyPrint
 
 --The environment must be returned for the parser to use.
-cf2jlex :: String -> CF -> Bool -> (Doc, SymEnv)
-cf2jlex packageBase cf jflex = (vcat
+cf2jlex :: JavaLexerParser -> RecordPositions -> String -> CF -> (Doc, SymEnv)
+cf2jlex jflex rp packageBase cf = (vcat
  [
-  prelude jflex packageBase,
+  prelude jflex rp packageBase,
   cMacros,
   lexSymbols jflex env,
-  text $ unlines $ restOfJLex cf
+  restOfJLex jflex rp cf
  ], env)
   where
-   env = makeSymEnv (symbols cf ++ reservedWords cf) (0 :: Int)
+   env = makeSymEnv (cfgSymbols cf ++ reservedWords cf) (0 :: Int)
    makeSymEnv [] _ = []
    makeSymEnv (s:symbs) n = (s, "_SYMB_" ++ show n) : makeSymEnv symbs (n+1)
 
-
 -- | File prelude
-prelude :: Bool -> String -> Doc
-prelude jflex packageBase = vcat
+prelude :: JavaLexerParser -> RecordPositions -> String -> Doc
+prelude jflex rp packageBase = vcat
     [ "// This JLex file was machine-generated by the BNF converter"
     , "package" <+> text packageBase <> ";"
     , ""
@@ -70,19 +74,54 @@
     , "%%"
     , "%cup"
     , "%unicode"
-    , "%line"
+    , (if rp == RecordPositions
+      then vcat
+        [ "%line"
+        , (if jflex == JFlexCup then "%column" else "")
+        , "%char" ]
+      else "")
     , "%public"
     , "%{"
     , nest 2 $ vcat
         [ "String pstring = new String();"
+        , "final int unknown = -1;"
+        , "ComplexSymbolFactory.Location left = new ComplexSymbolFactory.Location(unknown, unknown);"
+        , "ComplexSymbolFactory cf = new ComplexSymbolFactory();"
+        , "public SymbolFactory getSymbolFactory() { return cf; }"
+        , positionDeclarations
         , "public int line_num() { return (yyline+1); }"
+        , "public ComplexSymbolFactory.Location left_loc() {"
+        , if rp == RecordPositions
+            then "  return new ComplexSymbolFactory.Location(yyline+1, yycolumn+1, yychar);"
+            else "  return left;"
+        , "}"
+        , "public ComplexSymbolFactory.Location right_loc() {"
+        , "  ComplexSymbolFactory.Location left = left_loc();"
+        , (if rp == RecordPositions
+            then "return new ComplexSymbolFactory.Location(left.getLine(), left.getColumn()+yylength(), left.getOffset()+yylength());"
+            else "return left;")
+        , "}"
         , "public String buff()" <+> braces
-            (if jflex
+            (if jflex == JFlexCup
             then "return new String(zzBuffer,zzCurrentPos,10).trim();"
             else "return new String(yy_buffer,yy_buffer_index,10).trim();")
         ]
     , "%}"
+    , if jflex /= JFlexCup then vcat ["%eofval{"
+      , "  return cf.newSymbol(\"EOF\", sym.EOF, left_loc(), left_loc());"
+      , "%eofval}"]
+        else ""
     ]
+  where
+    positionDeclarations =
+      -- JFlex always defines yyline, yychar, yycolumn, even if unused.
+      if jflex == JFlexCup then ""
+        else if rp == RecordPositions then "int yycolumn = unknown - 1;"
+          else vcat
+            -- subtract one so that one based numbering still ends up with unknown.
+            [ "int yyline = unknown - 1;"
+            , "int yycolumn = unknown - 1;"
+            , "int yychar = unknown;" ]
 
 --For now all categories are included.
 --Optimally only the ones that are used should be generated.
@@ -103,90 +142,137 @@
   ]
 
 -- |
--- >>> lexSymbols False [("foo","bar")]
--- <YYINITIAL>foo { return new Symbol(sym.bar); }
--- >>> lexSymbols False [("\\","bar")]
--- <YYINITIAL>\\ { return new Symbol(sym.bar); }
--- >>> lexSymbols False [("/","bar")]
--- <YYINITIAL>/ { return new Symbol(sym.bar); }
--- >>> lexSymbols True [("/","bar")]
--- <YYINITIAL>\/ { return new Symbol(sym.bar); }
--- >>> lexSymbols True [("~","bar")]
--- <YYINITIAL>\~ { return new Symbol(sym.bar); }
-lexSymbols :: Bool -> SymEnv -> Doc
+-- >>> lexSymbols JLexCup [("foo","bar")]
+-- <YYINITIAL>foo { return cf.newSymbol("", sym.bar, left_loc(), right_loc()); }
+-- >>> lexSymbols JLexCup [("\\","bar")]
+-- <YYINITIAL>\\ { return cf.newSymbol("", sym.bar, left_loc(), right_loc()); }
+-- >>> lexSymbols JLexCup [("/","bar")]
+-- <YYINITIAL>/ { return cf.newSymbol("", sym.bar, left_loc(), right_loc()); }
+-- >>> lexSymbols JFlexCup [("/","bar")]
+-- <YYINITIAL>\/ { return cf.newSymbol("", sym.bar, left_loc(), right_loc()); }
+-- >>> lexSymbols JFlexCup [("~","bar")]
+-- <YYINITIAL>\~ { return cf.newSymbol("", sym.bar, left_loc(), right_loc()); }
+lexSymbols :: JavaLexerParser -> SymEnv -> Doc
 lexSymbols jflex ss = vcat $  map transSym ss
   where
     transSym (s,r) =
-      "<YYINITIAL>" <> text (escapeChars s) <> " { return new Symbol(sym."
-      <> text r <> "); }"
+      "<YYINITIAL>" <> text (escapeChars s) <> " { return cf.newSymbol(\"\", sym."
+      <> text r <> ", left_loc(), right_loc()); }"
     --Helper function that escapes characters in strings
     escapeChars :: String -> String
     escapeChars = concatMap (escapeChar jflex)
 
-restOfJLex :: CF -> [String]
-restOfJLex cf =
-  [
-   lexComments (comments cf),
-   userDefTokens,
-   ifC catString strStates,
-   ifC catChar chStates,
-   ifC catDouble "<YYINITIAL>{DIGIT}+\".\"{DIGIT}+(\"e\"(\\-)?{DIGIT}+)? { return new Symbol(sym._DOUBLE_, new Double(yytext())); }",
-   ifC catInteger "<YYINITIAL>{DIGIT}+ { return new Symbol(sym._INTEGER_, new Integer(yytext())); }",
-   ifC catIdent "<YYINITIAL>{LETTER}{IDENT}* { return new Symbol(sym._IDENT_, yytext().intern()); }"
-   , "<YYINITIAL>[ \\t\\r\\n\\f] { /* ignore white space. */ }"
-   ]
-  where
-   ifC cat s = if isUsedCat cf cat then s else ""
-   userDefTokens = unlines $
-     ["<YYINITIAL>" ++ printRegJLex exp +++
-      "{ return new Symbol(sym." ++ show name ++ ", yytext().intern()); }"
-       | (name, exp) <- tokenPragmas cf]
-   strStates = unlines --These handle escaped characters in Strings.
-    [
-     "<YYINITIAL>\"\\\"\" { yybegin(STRING); }",
-     "<STRING>\\\\ { yybegin(ESCAPED); }",
-     "<STRING>\\\" { String foo = pstring; pstring = new String(); yybegin(YYINITIAL); return new Symbol(sym._STRING_, foo.intern()); }",
-     "<STRING>.  { pstring += yytext(); }",
-     "<ESCAPED>n { pstring +=  \"\\n\"; yybegin(STRING); }",
-     "<ESCAPED>\\\" { pstring += \"\\\"\"; yybegin(STRING); }",
-     "<ESCAPED>\\\\ { pstring += \"\\\\\"; yybegin(STRING); }",
-     "<ESCAPED>t  { pstring += \"\\t\"; yybegin(STRING); }",
-     "<ESCAPED>.  { pstring += yytext(); yybegin(STRING); }"
-    ]
-   chStates = unlines --These handle escaped characters in Chars.
-    [
-     "<YYINITIAL>\"'\" { yybegin(CHAR); }",
-     "<CHAR>\\\\ { yybegin(CHARESC); }",
-     "<CHAR>[^'] { yybegin(CHAREND); return new Symbol(sym._CHAR_, new Character(yytext().charAt(0))); }",
-     "<CHARESC>n { yybegin(CHAREND); return new Symbol(sym._CHAR_, new Character('\\n')); }",
-     "<CHARESC>t { yybegin(CHAREND); return new Symbol(sym._CHAR_, new Character('\\t')); }",
-     "<CHARESC>. { yybegin(CHAREND); return new Symbol(sym._CHAR_, new Character(yytext().charAt(0))); }",
-     "<CHAREND>\"'\" {yybegin(YYINITIAL);}"
+restOfJLex :: JavaLexerParser -> RecordPositions -> CF -> Doc
+restOfJLex jflex rp cf = vcat
+    [ lexComments (comments cf)
+    , ""
+    , userDefTokens
+    , ifC catString strStates
+    , ifC catChar chStates
+    , ifC catDouble
+        "<YYINITIAL>{DIGIT}+\".\"{DIGIT}+(\"e\"(\\-)?{DIGIT}+)? { return cf.newSymbol(\"\", sym._DOUBLE_, left_loc(), right_loc(), new Double(yytext())); }"
+    , ifC catInteger
+        "<YYINITIAL>{DIGIT}+ { return cf.newSymbol(\"\", sym._INTEGER_, left_loc(), right_loc(), new Integer(yytext())); }"
+    , ifC catIdent
+        "<YYINITIAL>{LETTER}{IDENT}* { return cf.newSymbol(\"\", sym._IDENT_, left_loc(), right_loc(), yytext().intern()); }"
+    , "<YYINITIAL>[ \\t\\r\\n\\f] { /* ignore white space. */ }"
+    , if jflex == JFlexCup
+        then "<<EOF>> { return cf.newSymbol(\"EOF\", sym.EOF, left_loc(), left_loc()); }"
+        else ""
+    , if rp == RecordPositions
+        then ". { throw new Error(\"Illegal Character <\"+yytext()+\"> at \"+(yyline+1)" <>
+          (if jflex == JFlexCup then "+\":\"+(yycolumn+1)+\"(\"+yychar+\")\"" else "") <> "); }"
+        else ". { throw new Error(\"Illegal Character <\"+yytext()+\">\"); }"
     ]
-
-
-
+  where
+    ifC cat s = if isUsedCat cf cat then s else ""
+    userDefTokens = vcat
+        [ "<YYINITIAL>" <> text (printRegJLex exp)
+            <+> "{ return cf.newSymbol(\"\", sym." <> text (show name)
+            <> ", left_loc(), right_loc(), yytext().intern()); }"
+        | (name, exp) <- tokenPragmas cf ]
+    strStates = vcat --These handle escaped characters in Strings.
+        [ "<YYINITIAL>\"\\\"\" { left = left_loc(); yybegin(STRING); }"
+        , "<STRING>\\\\ { yybegin(ESCAPED); }"
+        , "<STRING>\\\" { String foo = pstring; pstring = new String(); yybegin(YYINITIAL); return cf.newSymbol(\"\", sym._STRING_, left, right_loc(), foo.intern()); }"
+        , "<STRING>.  { pstring += yytext(); }"
+        , "<STRING>\\r\\n|\\r|\\n { throw new Error(\"Unterminated string on line \" + left.getLine() " <>
+          (if jflex == JFlexCup then "+ \" begining at column \" + left.getColumn()" else "") <> "); }"
+        , if jflex == JFlexCup
+          then "<STRING><<EOF>> { throw new Error(\"Unterminated string at EOF, beginning at \" + left.getLine() + \":\" + left.getColumn()); }"
+          else ""
+        , "<ESCAPED>n { pstring +=  \"\\n\"; yybegin(STRING); }"
+        , "<ESCAPED>\\\" { pstring += \"\\\"\"; yybegin(STRING); }"
+        , "<ESCAPED>\\\\ { pstring += \"\\\\\"; yybegin(STRING); }"
+        , "<ESCAPED>t  { pstring += \"\\t\"; yybegin(STRING); }"
+        , "<ESCAPED>.  { pstring += yytext(); yybegin(STRING); }"
+        , "<ESCAPED>\\r\\n|\\r|\\n { throw new Error(\"Unterminated string on line \" + left.getLine() " <>
+          (if jflex == JFlexCup then "+ \" beginning at column \" + left.getColumn()" else "") <> "); }"
+        , if jflex == JFlexCup
+          then "<ESCAPED><<EOF>> { throw new Error(\"Unterminated string at EOF, beginning at \" + left.getLine() + \":\" + left.getColumn()); }"
+          else ""
+        ]
+    chStates = vcat --These handle escaped characters in Chars.
+        [ "<YYINITIAL>\"'\" { left = left_loc(); yybegin(CHAR); }"
+        , "<CHAR>\\\\ { yybegin(CHARESC); }"
+        , "<CHAR>[^'] { yybegin(CHAREND); return cf.newSymbol(\"\", sym._CHAR_, left, right_loc(), new Character(yytext().charAt(0))); }"
+        , "<CHAR>\\r\\n|\\r|\\n { throw new Error(\"Unterminated character literal on line \" + left.getLine() " <>
+          (if jflex == JFlexCup then "+ \" beginning at column \" + left.getColumn()" else "") <> "); }"
+        , if jflex == JFlexCup
+          then "<CHAR><<EOF>> { throw new Error(\"Unterminated character literal at EOF, beginning at \" + left.getLine() + \":\" + left.getColumn()); }"
+          else ""
+        , "<CHARESC>n { yybegin(CHAREND); return cf.newSymbol(\"\", sym._CHAR_, left, right_loc(), new Character('\\n')); }"
+        , "<CHARESC>t { yybegin(CHAREND); return cf.newSymbol(\"\", sym._CHAR_, left, right_loc(), new Character('\\t')); }"
+        , "<CHARESC>. { yybegin(CHAREND); return cf.newSymbol(\"\", sym._CHAR_, left, right_loc(), new Character(yytext().charAt(0))); }"
+        , "<CHARESC>\\r\\n|\\r|\\n { throw new Error(\"Unterminated character literal on line \" + left.getLine() " <>
+          (if jflex == JFlexCup then "+ \" beginning at column \" + left.getColumn()" else "") <> "); }"
+        , if jflex == JFlexCup
+          then "<CHARESC><<EOF>> { throw new Error(\"Unterminated character literal at EOF, beginning at \" + left.getLine() + \":\" + left.getColumn()); }"
+          else ""
+        , "<CHAREND>\"'\" {yybegin(YYINITIAL);}"
+        , "<CHAREND>\\r\\n|\\r|\\n { throw new Error(\"Unterminated character literal on line \" + left.getLine() " <>
+          (if jflex == JFlexCup then "+ \" beginning at column \" + left.getColumn()" else "") <> "); }"
+        , if jflex == JFlexCup
+          then "<CHAREND><<EOF>> { throw new Error(\"Unterminated character literal at EOF, beginning at \" + left.getLine() + \":\" + left.getColumn()); }"
+          else ""
+        ]
 
-lexComments :: ([(String, String)], [String]) -> String
+lexComments :: ([(String, String)], [String]) -> Doc
 lexComments (m,s) =
-  (unlines (map lexSingleComment s))
-  ++ (unlines (map lexMultiComment m))
+    vcat (map lexSingleComment s ++ map lexMultiComment m)
 
-lexSingleComment :: String -> String
+-- | Create lexer rule for single-line comments.
+--
+-- >>> lexSingleComment "--"
+-- <YYINITIAL>"--"[^\n]*\n { /* skip */ }
+--
+-- >>> lexSingleComment "\""
+-- <YYINITIAL>"\""[^\n]*\n { /* skip */ }
+lexSingleComment :: String -> Doc
 lexSingleComment c =
-  "<YYINITIAL>\"" ++ c ++ "\"[^\\n]*\\n { /* BNFC single-line comment */ }"
-
---There might be a possible bug here if a language includes 2 multi-line comments.
---They could possibly start a comment with one character and end it with another.
---However this seems rare.
-lexMultiComment :: (String, String) -> String
-lexMultiComment (b,e) = unlines [
-  "<YYINITIAL>\"" ++ b ++ "\" { yybegin(COMMENT); }",
-  "<COMMENT>\"" ++ e ++ "\" { yybegin(YYINITIAL); }",
-  "<COMMENT>. { }",
-  "<COMMENT>[\\n] { }"
-  ]
-
--- lexReserved :: String -> String
--- lexReserved s = "<YYINITIAL>\"" ++ s ++ "\" { return new Symbol(sym.TS, yytext()); }"
+  "<YYINITIAL>" <> cstring c <>  "[^\\n]*\\n { /* skip */ }"
 
+-- | Create lexer rule for multi-lines comments.
+--
+-- There might be a possible bug here if a language includes 2 multi-line
+-- comments. They could possibly start a comment with one character and end it
+-- with another. However this seems rare.
+--
+-- >>> lexMultiComment ("{-", "-}")
+-- <YYINITIAL>"{-" { yybegin(COMMENT); }
+-- <COMMENT>"-}" { yybegin(YYINITIAL); }
+-- <COMMENT>. { /* skip */ }
+-- <COMMENT>[\n] { /* skip */ }
+--
+-- >>> lexMultiComment ("\"'", "'\"")
+-- <YYINITIAL>"\"'" { yybegin(COMMENT); }
+-- <COMMENT>"'\"" { yybegin(YYINITIAL); }
+-- <COMMENT>. { /* skip */ }
+-- <COMMENT>[\n] { /* skip */ }
+lexMultiComment :: (String, String) -> Doc
+lexMultiComment (b,e) = vcat
+    [ "<YYINITIAL>" <> cstring b <+> "{ yybegin(COMMENT); }"
+    , "<COMMENT>" <> cstring e <+> "{ yybegin(YYINITIAL); }"
+    , "<COMMENT>. { /* skip */ }"
+    , "<COMMENT>[\\n] { /* skip */ }"
+    ]
diff --git a/src/BNFC/Backend/Java/CFtoJavaAbs15.hs b/src/BNFC/Backend/Java/CFtoJavaAbs15.hs
--- a/src/BNFC/Backend/Java/CFtoJavaAbs15.hs
+++ b/src/BNFC/Backend/Java/CFtoJavaAbs15.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE NoImplicitPrelude, OverloadedStrings #-}
 {-
     BNF Converter: Java 1.5 Abstract Syntax
     Copyright (C) 2004  Author:  Michael Pellauer, Bjorn Bringert
@@ -15,7 +15,7 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 {-
@@ -44,9 +44,12 @@
    **************************************************************
 -}
 
-module BNFC.Backend.Java.CFtoJavaAbs15 (cf2JavaAbs, typename) where
+module BNFC.Backend.Java.CFtoJavaAbs15 (cf2JavaAbs, typename, cat2JavaType) where
 
+import Prelude'
+
 import BNFC.CF
+import BNFC.Options (RecordPositions(..))
 import BNFC.Utils((+++),(++++))
 import BNFC.Backend.Common.NamedVariables hiding (IVar, getVars, varName)
 import Data.Function (on)
@@ -60,24 +63,26 @@
 --They also allow users to use the Visitor design pattern.
 
 type IVar = (String, Int, String)
---The type of an instance variable
---a # unique to that type
---and an optional name (handles typedefs).
+-- ^ The type of an instance variable,
+--   a number unique to that type,
+--   and an optional name (handles typedefs).
 
---The result is a list of files which must be written to disk.
---The tuple is (FileName, FileContents)
-cf2JavaAbs :: String -> String -> CF -> [(FilePath, String)]
-cf2JavaAbs _ packageAbsyn cf =
-    concatMap (prData header packageAbsyn user) rules
+-- | The result is a list of files which must be written to disk.
+--   The tuple is (FileName, FileContents)
+
+cf2JavaAbs :: String -> String -> CF -> RecordPositions -> [(FilePath, String)]
+cf2JavaAbs _ packageAbsyn cf rp =
+    concatMap (prData rp header packageAbsyn user) rules
  where
   header = "package " ++ packageAbsyn ++ "; // Java Package generated by the BNF Converter.\n"
   user = [n | (n,_) <- tokenPragmas cf]
   rules = getAbstractSyntax cf
 
---Generates a (possibly abstract) category class, and classes for all its rules.
-prData :: String -> String -> [UserDef] -> Data ->[(String, String)]
-prData header packageAbsyn user (cat, rules) =
-  categoryClass ++ mapMaybe (prRule header packageAbsyn funs user cat) rules
+-- | Generates a (possibly abstract) category class, and classes for all its rules.
+
+prData :: RecordPositions -> String -> String -> [UserDef] -> Data ->[(String, String)]
+prData rp header packageAbsyn user (cat, rules) =
+  categoryClass ++ mapMaybe (prRule rp header packageAbsyn funs user cat) rules
       where
       funs = map fst rules
       categoryClass
@@ -103,49 +108,48 @@
     where
     prVisitFun f = "    public R visit(" ++ packageAbsyn ++ "." ++ f ++ " p, A arg);"
 
---Generates classes for a rule, depending on what type of rule it is.
-prRule :: String   -- ^ Header
-       -> String   -- ^ Abstract syntax package name
-       -> [String] -- ^ Names of all constructors in the category
+-- | Generates classes for a rule, depending on what type of rule it is.
+
+prRule :: RecordPositions     -- ^ Include line number info in generated classes.
+       -> String   -- ^ Header.
+       -> String   -- ^ Abstract syntax package name.
+       -> [String] -- ^ Names of all constructors in the category.
        -> [UserDef] -> Cat -> (Fun, [Cat]) -> Maybe (String, String)
-prRule h packageAbsyn funs user c (fun, cats)
-  | isNilFun fun || isOneFun fun = Nothing  --these are not represented in the AbSyn
-  | isConsFun fun =Just (fun', --this is the linked list case.
-    unlines
-    [
-     h,
-     "public class" +++ fun' +++ "extends java.util.LinkedList<"++ et ++"> {",
-     "}"
-    ])
-  | otherwise = Just (fun, --a standard rule
-    unlines
-    [
-     h,
-     "public class" +++ fun ++ ext +++ "{",
-     render $ nest 2 $ vcat
-        [ prInstVars vs
-        , prConstructor fun user vs cats],
-     prAccept packageAbsyn c fun,
-     prEquals packageAbsyn fun vs,
-     prHashCode packageAbsyn fun vs,
-     if isAlsoCategory then prVisitor packageAbsyn funs else "",
-     "}"
-    ])
+prRule rp h packageAbsyn funs user c (fun, cats)
+  | isNilFun fun || isOneFun fun = Nothing  -- these are not represented in the Absyn
+  | isConsFun fun = Just . (fun',) . unlines $ -- this is the linked list case.
+      [ h
+      , unwords [ "public class", fun', "extends", cat2JavaTypeTopList user c, "{" ]
+      , "}"
+      ]
+  | otherwise = Just . (fun,) . unlines $ -- a standard rule
+      [ h
+      , unwords [ "public class", fun, ext, "{" ]
+      , render $ nest 2 $ vcat
+          [ prInstVars rp vs
+          , prConstructor fun user vs cats
+          ]
+      , prAccept packageAbsyn c fun
+      , prEquals packageAbsyn fun vs
+      , prHashCode packageAbsyn fun vs
+      , if isAlsoCategory then prVisitor packageAbsyn funs else ""
+      , "}"
+      ]
    where
      vs = getVars cats user
      fun' = identCat (normCat c)
      isAlsoCategory = fun == show c
      --This handles the case where a LBNF label is the same as the category.
      ext = if isAlsoCategory then "" else " extends" +++ identCat c
-     et = typename (show $ normCatOfList c) user
 
+-- | The standard accept function for the Visitor pattern.
 
---The standard accept function for the Visitor pattern
 prAccept :: String -> Cat -> String -> String
 prAccept pack cat _ = "\n  public <R,A> R accept(" ++ pack ++ "." ++ show cat
                       ++ ".Visitor<R,A> v, A arg) { return v.visit(this, arg); }\n"
 
--- Creates the equals() method.
+-- | Creates the equals() method.
+
 prEquals :: String -> String -> [IVar] -> String
 prEquals pack fun vs =
     unlines $ map ("  "++) $ ["public boolean equals(Object o) {",
@@ -164,7 +168,8 @@
   checkKid iv = "this." ++ v ++ ".equals(x." ++ v ++ ")"
       where v = render (iVarName iv)
 
--- Creates the equals() method.
+-- | Creates the equals() method.
+
 prHashCode :: String -> String -> [IVar] -> String
 prHashCode _ _ vs =
     unlines $ map ("  "++) ["public int hashCode() {",
@@ -180,13 +185,22 @@
 
 
 -- | A class's instance variables.
--- >>> prInstVars [("A",1,""), ("B",1,""), ("A",2,"abc")]
+--
+-- >>> prInstVars NoRecordPositions [("A",1,""), ("B",1,""), ("A",2,"abc")]
 -- public final A _1, abc_2;
 -- public final B _1;
-prInstVars :: [IVar] -> Doc
-prInstVars [] = empty
-prInstVars vars@((t,_,_):_) =
-    "public" <+> "final" <+> text t <+> uniques <> ";" $$ prInstVars vs'
+--
+-- >>> prInstVars RecordPositions [("A",1,""), ("B",1,""), ("A",2,"abc")]
+-- public final A _1, abc_2;
+-- public final B _1;
+-- public int line_num, col_num, offset;
+
+prInstVars :: RecordPositions -> [IVar] -> Doc
+prInstVars rp [] = case rp of
+  RecordPositions -> "public int line_num, col_num, offset;"
+  NoRecordPositions -> empty
+prInstVars rp vars@((t,_,_):_) =
+    "public" <+> "final" <+> text t <+> uniques <> ";" $$ prInstVars rp vs'
  where
    (uniques, vs') = prUniques t vars
    --these functions group the types together nicely
@@ -199,22 +213,29 @@
     | t == t2 = remType t ts
     | otherwise = (t2,n,nm) : remType t ts
 
--- | Convert IVar to java name
+-- | Convert IVar to java name.
+--
 -- >>> iVarName ("A",1,"abc")
 -- abc_1
+--
 -- >>> iVarName ("C", 2, "")
 -- _2
+--
 -- >>> iVarName ("Integer", 0, "integer")
 -- integer_
+
 iVarName :: IVar -> Doc
 iVarName (_,n,nm) = text (varName nm) <> text (showNum n)
 
 -- | The constructor just assigns the parameters to the corresponding instance
 -- variables.
+--
 -- >>> prConstructor "bla" [] [("A",1,"a"),("B",1,""),("A",2,"")] [Cat "A",Cat "B", Cat "C"]
 -- public bla(A p1, B p2, C p3) { a_1 = p1; _ = p2; _2 = p3; }
+--
 -- >>> prConstructor "EInt" [] [("Integer",0,"integer")] [Cat "Integer"]
 -- public EInt(Integer p1) { integer_ = p1; }
+
 prConstructor :: String -> [UserDef] -> [IVar] -> [Cat] -> Doc
 prConstructor c u vs cats =
     "public" <+> text c <> parens (interleave types params)
@@ -223,13 +244,15 @@
    (types, params) = unzip (prParams cats u (length cats) (length cats+1))
    interleave xs ys = hsep $ punctuate "," $ zipWith ((<+>) `on` text) xs ys
 
---Prints the parameters to the constructors.
+-- | Prints the parameters to the constructors.
+
 prParams :: [Cat] -> [UserDef] -> Int -> Int -> [(String,String)]
 prParams [] _ _ _ = []
 prParams (c:cs) u n m = (typename (identCat c) u, 'p' : show (m-n))
                         : prParams cs u (n-1) m
 
---This algorithm peeks ahead in the list so we don't use map or fold
+-- | This algorithm peeks ahead in the list so we don't use @map@ or @fold@.
+
 prAssigns :: [IVar] -> [String] -> String
 prAssigns [] _ = []
 prAssigns _ [] = []
@@ -240,8 +263,9 @@
     _ -> varName nm ++ showNum n +++ "=" +++ p ++ ";" +++ prAssigns vs ps
  else varName nm ++ showNum n +++ "=" +++ p ++ ";" +++ prAssigns vs ps
 
--- Different than the standard BNFC.Backend.Common.NamedVariables version
+-- | Different than the standard ''BNFC.Backend.Common.NamedVariables'' version
 -- because of the user-defined types.
+
 getVars :: [Cat] -> [UserDef] -> [IVar]
 getVars cs user = reverse $ singleToZero $ foldl addVar [] (map identCat cs)
  where
@@ -256,9 +280,26 @@
         -> String -- ^ Variable name
 varName c = map toLower c ++ "_"
 
---This makes up for the fact that there's no typedef in Java
+-- | This makes up for the fact that there's no typedef in Java.
+
 typename :: String -> [UserDef] -> String
 typename t user | t == "Ident"            = "String"
                 | t == "Char"             = "Character"
                 | t `elem` map show user  = "String"
                 | otherwise               = t
+
+-- | Print the Java type corresponding to a category.
+cat2JavaType :: [UserDef] -> Cat -> String
+cat2JavaType user = loop
+  where
+  loop = \case
+    ListCat c -> "List" ++ loop c
+    -- ListCat c -> "java.util.LinkedList<" ++ loop c ++ ">"
+    c -> typename (show $ normCat c) user
+
+-- | Print the Java type corresponding to a category.
+--   The top list is printed as @java.util.LinkedList<...>@.
+cat2JavaTypeTopList :: [UserDef] -> Cat -> String
+cat2JavaTypeTopList user = \case
+  ListCat c -> "java.util.LinkedList<" ++ cat2JavaType user c ++ ">"
+  c -> cat2JavaType user c
diff --git a/src/BNFC/Backend/Java/CFtoJavaPrinter15.hs b/src/BNFC/Backend/Java/CFtoJavaPrinter15.hs
--- a/src/BNFC/Backend/Java/CFtoJavaPrinter15.hs
+++ b/src/BNFC/Backend/Java/CFtoJavaPrinter15.hs
@@ -1,3 +1,5 @@
+{-# LANGUAGE NoImplicitPrelude #-}
+
 {-
     BNF Converter: Java Pretty Printer generator
     Copyright (C) 2004  Author:  Michael Pellauer, Bjorn Bringert
@@ -14,7 +16,7 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 
@@ -46,14 +48,16 @@
 -}
 module BNFC.Backend.Java.CFtoJavaPrinter15 ( cf2JavaPrinter ) where
 
+import Prelude'
+
 import BNFC.Backend.Java.CFtoJavaAbs15
 
 import BNFC.CF
 import BNFC.Backend.Common (renderListSepByPrecedence)
 import BNFC.Backend.Common.NamedVariables
-import BNFC.Utils		( (+++) )
+import BNFC.Utils ( (+++) )
 import Data.List
-import Data.Char	( toLower, isSpace )
+import Data.Char ( toLower, isSpace )
 import Data.Either (lefts)
 import BNFC.PrettyPrint
 
@@ -186,11 +190,11 @@
 
 prEntryPoints :: String -> CF -> String
 prEntryPoints packageAbsyn cf =
-    msg ++ concat (map prEntryPoint (allCats cf)) ++ msg2
+    msg ++ concatMap prEntryPoint (allCats cf) ++ msg2
  where
   msg = "  //  print and show methods are defined for each category.\n"
   msg2 = "  /***   You shouldn't need to change anything beyond this point.   ***/\n"
-  prEntryPoint cat | (normCat cat) == cat = unlines
+  prEntryPoint cat | normCat cat == cat = unlines
    [
     "  public static String print(" ++ packageAbsyn ++ "." ++ cat' ++ " foo)",
     "  {",
@@ -213,43 +217,45 @@
   prEntryPoint _ = ""
 
 prData :: String ->  [UserDef] -> (Cat, [Rule]) -> String
-prData packageAbsyn user (cat, rules) =
- if isList cat
- then unlines
- [
-  "  private static void pp(" ++ packageAbsyn ++ "."
-      ++ identCat (normCat cat) +++ "foo, int _i_)",
-  "  {",
-  render $ nest 5 $ prList user cat rules <> "  }"
- ]
- else unlines --not a list
- [
-  "  private static void pp(" ++ packageAbsyn ++ "." ++ identCat (normCat cat) +++ "foo, int _i_)",
-  "  {",
-  (concat (addElse $ map (prRule packageAbsyn) rules)) ++ "  }"
- ]
-  where addElse = map ("    "++). intersperse "else " . filter (not . null) . map (dropWhile isSpace)
+prData packageAbsyn user (cat, rules) = unlines k
+    where
+      k = if isList cat
+           then
+           ["  private static void pp(" ++ packageAbsyn ++ "."
+                ++ identCat (normCat cat) +++ "foo, int _i_)"
+            , "  {"
+            , render $ nest 5 $ prList user cat rules <> "  }"
+           ]
+           else --not a list
+           [
+            "  private static void pp(" ++ packageAbsyn ++ "."
+                ++ identCat (normCat cat) +++ "foo, int _i_)",
+            "  {",
+            concat (addElse $ map (prRule packageAbsyn) rules) ++ "  }"
+           ]
+      addElse = map ("    "++). intersperse "else " . filter (not . null)
+        . map (dropWhile isSpace)
 
+
 prRule :: String -> Rule -> String
 prRule packageAbsyn r@(Rule fun _c cats) | not (isCoercion fun || isDefinedRule fun) = concat
-  [
-   "    if (foo instanceof" +++ packageAbsyn ++ "." ++ fun ++ ")\n",
-   "    {\n",
-   "       " ++ packageAbsyn ++ "." ++ fun +++ fnm +++ "= ("
-     ++ packageAbsyn ++ "." ++ fun ++ ") foo;\n",
-   lparen,
-   cats',
-   rparen,
-   "    }\n"
-  ]
-   where
+    [ "    if (foo instanceof" +++ packageAbsyn ++ "." ++ fun ++ ")\n"
+    , "    {\n"
+    , "       " ++ packageAbsyn ++ "." ++ fun +++ fnm +++ "= ("
+        ++ packageAbsyn ++ "." ++ fun ++ ") foo;\n"
+    , lparen
+    , cats'
+    , rparen
+    , "    }\n"
+    ]
+  where
     p = precRule r
     (lparen, rparen) =
-     ("       if (_i_ > " ++ (show p) ++ ") render(_L_PAREN);\n",
-      "       if (_i_ > " ++ (show p) ++ ") render(_R_PAREN);\n")
+        ("       if (_i_ > " ++ show p ++ ") render(_L_PAREN);\n",
+        "       if (_i_ > " ++ show p ++ ") render(_R_PAREN);\n")
     cats' = case cats of
         [] -> ""
-    	_  -> concatMap (render . prCat (text fnm)) (numVars cats)
+        _  -> concatMap (render . prCat (text fnm)) (numVars cats)
     fnm = '_' : map toLower fun
 
 prRule _nm _ = ""
@@ -267,6 +273,7 @@
 --     render(".");
 --   }
 -- }
+
 prList :: [UserDef] -> Cat -> [Rule] -> Doc
 prList user c rules =
     "for (java.util.Iterator<" <> et <> "> it = foo.iterator(); it.hasNext();)"
@@ -280,7 +287,7 @@
         , "}"
         ]
    where
-    et = text (typename (show $ normCatOfList c) user)
+    et = text $ cat2JavaType user $ normCatOfList c
     sep = escapeChars $ getCons rules
     optsep = if hasOneFunc rules then "" else sep
     renderSep x = "render(\"" <> text x <>"\")"
@@ -289,7 +296,7 @@
 -- >>> prCat "F" (Right "++")
 --        render("++");
 -- <BLANKLINE>
--- >>> prCat "F" (Left (Cat "String", "string_"))
+-- >>> prCat "F" (Left (TokenCat "String", "string_"))
 --        printQuoted(F.string_);
 -- <BLANKLINE>
 -- >>> prCat "F" (Left (InternalCat, "#_"))
@@ -299,7 +306,7 @@
 -- <BLANKLINE>
 prCat :: Doc -> Either (Cat, Doc) String -> Doc
 prCat _ (Right t) = nest 7 ("render(\"" <> text(escapeChars t) <> "\");\n")
-prCat fnm (Left (Cat "String", nt))
+prCat fnm (Left (TokenCat "String", nt))
     = nest 7 ("printQuoted(" <> fnm <> "." <> nt <> ");\n")
 prCat _ (Left (InternalCat, _)) = empty
 prCat fnm (Left (cat, nt))
@@ -308,45 +315,42 @@
 --The following methods generate the Show function.
 
 shData :: String -> [UserDef] -> (Cat, [Rule]) -> String
-shData packageAbsyn user (cat, rules) =
- if isList cat
- then unlines
- [
-  "  private static void sh(" ++ packageAbsyn ++ "." ++ identCat (normCat cat) +++ "foo)",
-  "  {",
-  (shList user cat rules) ++ "  }"
- ]
- else unlines
- [
-  "  private static void sh(" ++ packageAbsyn ++ "." ++ identCat (normCat cat) +++ "foo)",
-  "  {",
-  (concat (map (shRule packageAbsyn) rules)) ++ "  }"
- ]
+shData packageAbsyn user (cat, rules) = unlines k
+    where
+      k = if isList cat
+          then
+          [ "  private static void sh(" ++ packageAbsyn ++ "."
+                ++ identCat (normCat cat) +++ "foo)"
+          , "  {"
+          , shList user cat rules ++ "  }"
+          ]
+          else
+          [ "  private static void sh(" ++ packageAbsyn ++ "."
+                ++ identCat (normCat cat) +++ "foo)"
+          , "  {"
+          , concatMap (shRule packageAbsyn) rules ++ "  }"
+          ]
 
+
 shRule :: String -> Rule -> String
 shRule packageAbsyn (Rule fun _c cats) | not (isCoercion fun || isDefinedRule fun) = unlines
-  [
-   "    if (foo instanceof" +++ packageAbsyn ++ "." ++ fun ++ ")",
-   "    {",
-   "       " ++ packageAbsyn ++ "." ++ fun +++ fnm +++ "= ("
-     ++ packageAbsyn ++ "." ++ fun ++ ") foo;",
-   members ++ "    }"
-  ]
-   where
-    members = concat
-     [
-      lparen,
-      "       render(\"" ++ (escapeChars fun) ++ "\");\n",
-      cats',
-      rparen
-     ]
+    [ "    if (foo instanceof" +++ packageAbsyn ++ "." ++ fun ++ ")"
+    , "    {"
+    , "       " ++ packageAbsyn ++ "." ++ fun +++ fnm +++ "= ("
+        ++ packageAbsyn ++ "." ++ fun ++ ") foo;"
+    , members ++ "    }"
+    ]
+  where
+    members = concat [ lparen
+                     , "       render(\"" ++ escapeChars fun ++ "\");\n"
+                     , cats'
+                     , rparen ]
     cats' = if allTerms cats
         then ""
-    	else concatMap (render . shCat (text fnm)) (lefts (numVars cats))
-    (lparen, rparen) =
-      if allTerms cats
-         then ("","")
- 	 else ("       render(\"(\");\n","       render(\")\");\n")
+        else concatMap (render . shCat (text fnm)) (lefts (numVars cats))
+    (lparen, rparen) = if allTerms cats
+        then ("","")
+        else ("       render(\"(\");\n","       render(\")\");\n")
     allTerms [] = True
     allTerms ((Left {}):_) = False
     allTerms (_:zs) = allTerms zs
@@ -365,7 +369,7 @@
    "     }"
   ]
     where
-    et = typename (show $ normCatOfList c) user
+    et = cat2JavaType user $ normCatOfList c
 
 -- |
 -- >>> shCat "F" (ListCat (Cat "A"), "lista_")
@@ -389,6 +393,6 @@
 --Helper function that escapes characters in strings
 escapeChars :: String -> String
 escapeChars [] = []
-escapeChars ('\\':xs) = '\\' : ('\\' : (escapeChars xs))
-escapeChars ('\"':xs) = '\\' : ('\"' : (escapeChars xs))
-escapeChars (x:xs) = x : (escapeChars xs)
+escapeChars ('\\':xs) = '\\' : '\\' : escapeChars xs
+escapeChars ('\"':xs) = '\\' : '\"' : escapeChars xs
+escapeChars (x:xs) = x : escapeChars xs
diff --git a/src/BNFC/Backend/Java/CFtoVisitSkel15.hs b/src/BNFC/Backend/Java/CFtoVisitSkel15.hs
--- a/src/BNFC/Backend/Java/CFtoVisitSkel15.hs
+++ b/src/BNFC/Backend/Java/CFtoVisitSkel15.hs
@@ -1,3 +1,5 @@
+{-# LANGUAGE NoImplicitPrelude #-}
+
 {-
     BNF Converter: Java Vistor skeleton generator
     Copyright (C) 2004  Author:  Michael Pellauer, Bjorn Bringert
@@ -14,7 +16,7 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 {-
@@ -40,6 +42,8 @@
 -}
 module BNFC.Backend.Java.CFtoVisitSkel15 (cf2VisitSkel) where
 
+import Prelude'
+
 import BNFC.CF
 import BNFC.Backend.Java.CFtoJavaAbs15 (typename)
 import BNFC.Utils ((+++))
@@ -77,15 +81,15 @@
 
 --Traverses a category based on its type.
 prData :: String -> [UserDef] -> (Cat, [Rule]) -> String
-prData packageAbsyn user (cat, rules) =
- if isList cat
- then ""
- else unlines ["  public class " ++ identCat cat ++ "Visitor<R,A> implements "
-	       ++ identCat cat ++ ".Visitor<R,A>",
-	       "  {",
-	       concatMap (render . nest 4 . prRule packageAbsyn user) rules,
-	       "  }"
-	      ]
+prData packageAbsyn user (cat, rules)
+    | isList cat = ""
+    | otherwise = unlines
+        ["  public class " ++ identCat cat ++ "Visitor<R,A> implements "
+            ++ identCat cat ++ ".Visitor<R,A>"
+        , "  {"
+        , concatMap (render . nest 4 . prRule packageAbsyn user) rules
+        , "  }"
+        ]
 
 -- | traverses a standard rule.
 -- >>> prRule "ABSYN" [] (Rule "EInt" undefined [Left (TokenCat "Integer"), Left (Cat "NT")])
diff --git a/src/BNFC/Backend/Java/RegToAntlrLexer.hs b/src/BNFC/Backend/Java/RegToAntlrLexer.hs
new file mode 100644
--- /dev/null
+++ b/src/BNFC/Backend/Java/RegToAntlrLexer.hs
@@ -0,0 +1,81 @@
+module BNFC.Backend.Java.RegToAntlrLexer (printRegJLex, escapeChar) where
+
+-- modified from RegToJLex.hs
+
+import AbsBNF
+
+-- the top-level printing method
+printRegJLex :: Reg -> String
+printRegJLex = render . prt 0
+
+-- you may want to change render and parenth
+
+render :: [String] -> String
+render = rend (0 :: Int) where
+  rend i ss = case ss of
+    "["      :ts -> cons "["  $ rend i ts
+    "("      :ts -> cons "("  $ rend i ts
+    t  : "," :ts -> cons t    $ space "," $ rend i ts
+    t  : ")" :ts -> cons t    $ cons ")"  $ rend i ts
+    t  : "]" :ts -> cons t    $ cons "]"  $ rend i ts
+    t        :ts -> space t   $ rend i ts
+    _            -> ""
+  cons s t  = s ++ t
+  space t s = if null s then t else t ++ s
+
+parenth :: [String] -> [String]
+parenth ss = ["("] ++ ss ++ [")"]
+
+-- the printer class does the job
+class Print a where
+  prt :: Int -> a -> [String]
+  prtList :: [a] -> [String]
+  prtList = concatMap (prt 0)
+
+instance Print a => Print [a] where
+  prt _ = prtList
+
+instance Print Char where
+  prt _ c = [escapeChar c]
+  prtList = map (concat . prt 0)
+
+escapeChar :: Char -> String
+escapeChar x | x `elem` reserved = '\\' : [x]
+escapeChar x = [x]
+
+-- Characters that must be escaped in ANTLR regular expressions
+reserved :: [Char]
+reserved = ['\'','\\']
+
+prPrec :: Int -> Int -> [String] -> [String]
+prPrec i j = if j<i then parenth else id
+
+instance Print Ident where
+  prt _ (Ident i) = [i]
+
+instance Print Reg where
+  prt i e = case e of
+   RSeq reg0 reg
+              -> prPrec i 2 (concat [prt 2 reg0 , prt 3 reg])
+   RAlt reg0 reg
+              -> prPrec i 1 (concat [prt 1 reg0 , ["|"] , prt 2 reg])
+   -- JLex does not support set difference
+   --RMinus reg0 reg -> prPrec i 1 (concat [prt 2 reg0 , ["#"] , prt 2 reg])
+   RMinus reg0 REps -> prt i reg0 -- REps is identity for set difference
+   RMinus RAny reg@(RChar _)
+              ->  prPrec i 3 (concat [["~["],prt 0 reg,["]"]])
+   RMinus RAny (RAlts str)
+              ->  prPrec i 3 (concat [["~["],prt 0 str,["]"]])
+   RMinus _ _ -> error "Antlr does not support general set difference"
+   RStar reg  -> prPrec i 3 (concat [prt 3 reg , ["*"]])
+   RPlus reg  -> prPrec i 3 (concat [prt 3 reg , ["+"]])
+   ROpt reg   -> prPrec i 3 (concat [prt 3 reg , ["?"]])
+   REps       -> prPrec i 3 [""]
+   RChar c    -> prPrec i 3 (concat [["'"], prt 0 c, ["'"]])
+   RAlts str  -> prPrec i 3 (concat [["["],prt 0 str,["]"]])
+   RSeqs str  -> prPrec i 2 (concatMap (prt 0) str)
+   RDigit     -> prPrec i 3 ["DIGIT"]
+   RLetter    -> prPrec i 3 ["LETTER"]
+   RUpper     -> prPrec i 3 ["CAPITAL"]
+   RLower     -> prPrec i 3 ["SMALL"]
+   RAny       -> prPrec i 3 ["[\\u0000-\\u00FF]"]
diff --git a/src/BNFC/Backend/Java/RegToJLex.hs b/src/BNFC/Backend/Java/RegToJLex.hs
--- a/src/BNFC/Backend/Java/RegToJLex.hs
+++ b/src/BNFC/Backend/Java/RegToJLex.hs
@@ -3,6 +3,7 @@
 -- modified from pretty-printer generated by the BNF converter
 
 import AbsBNF
+import BNFC.Options (JavaLexerParser(..))
 
 -- the top-level printing method
 printRegJLex :: Reg -> String
@@ -30,19 +31,19 @@
 class Print a where
   prt :: Int -> a -> [String]
   prtList :: [a] -> [String]
-  prtList = concat . map (prt 0)
+  prtList = concatMap (prt 0)
 
 instance Print a => Print [a] where
   prt _ = prtList
 
 instance Print Char where
-  prt _ c = [escapeChar False c]
-  prtList s = map (concat . prt 0) s
+  prt _ c = [escapeChar JLexCup c]
+  prtList = map (concat . prt 0)
 
-escapeChar :: Bool -> Char -> String
+escapeChar :: JavaLexerParser -> Char -> String
 escapeChar _ '^' = "\\x5E" -- special case, since \^ is a control character escape
-escapeChar False x | x `elem` jlexReserved = '\\' : [x]
-escapeChar True x | x `elem` jflexReserved = '\\' : [x]
+escapeChar JFlexCup x | x `elem` jflexReserved = '\\' : [x]
+escapeChar _ x | x `elem` jlexReserved = '\\' : [x]
 escapeChar _ x = [x]
 
 -- Characters that must be escaped in JLex regular expressions
@@ -52,6 +53,7 @@
 jflexReserved :: [Char]
 jflexReserved = '~':'!':'/':jlexReserved
 
+
 prPrec :: Int -> Int -> [String] -> [String]
 prPrec i j = if j<i then parenth else id
 
@@ -69,17 +71,17 @@
    RMinus RAny reg@(RChar _) ->  prPrec i 3 (concat [["[^"],prt 0 reg,["]"]])
    RMinus RAny (RAlts str) ->  prPrec i 3 (concat [["[^"],prt 0 str,["]"]])
    -- FIXME: maybe we could add cases for char - RDigit, RLetter etc.
-   RMinus _ _ -> error $ "JLex does not support general set difference"
+   RMinus _ _ -> error  "JLex does not support general set difference"
 
    RStar reg -> prPrec i 3 (concat [prt 3 reg , ["*"]])
    RPlus reg -> prPrec i 3 (concat [prt 3 reg , ["+"]])
    ROpt reg  -> prPrec i 3 (concat [prt 3 reg , ["?"]])
-   REps  -> prPrec i 3 (["[^.]"])
-   RChar c -> prPrec i 3 (concat [prt 0 c])
+   REps  -> prPrec i 3 ["[^.]"]
+   RChar c -> prPrec i 3 (prt 0 c)
    RAlts str -> prPrec i 3 (concat [["["],prt 0 str,["]"]])
-   RSeqs str -> prPrec i 2 (concat (map (prt 0) str))
-   RDigit  -> prPrec i 3 (concat [["{DIGIT}"]])
-   RLetter  -> prPrec i 3 (concat [["{LETTER}"]])
-   RUpper  -> prPrec i 3 (concat [["{CAPITAL}"]])
-   RLower  -> prPrec i 3 (concat [["{SMALL}"]])
-   RAny  -> prPrec i 3 (concat [["."]])
+   RSeqs str -> prPrec i 2 (concatMap (prt 0) str)
+   RDigit  -> prPrec i 3 ["{DIGIT}"]
+   RLetter  -> prPrec i 3 ["{LETTER}"]
+   RUpper  -> prPrec i 3 ["{CAPITAL}"]
+   RLower  -> prPrec i 3 ["{SMALL}"]
+   RAny  -> prPrec i 3 ["."]
diff --git a/src/BNFC/Backend/Java/Utils.hs b/src/BNFC/Backend/Java/Utils.hs
new file mode 100644
--- /dev/null
+++ b/src/BNFC/Backend/Java/Utils.hs
@@ -0,0 +1,25 @@
+module BNFC.Backend.Java.Utils where
+import BNFC.Backend.Common.NamedVariables
+import BNFC.Utils ( mkName, NameStyle(..))
+
+javaReserved = [
+    "abstract"   ,"continue"   ,"for"   ,"new"   ,"switch"
+    ,"assert"  ,"default"   ,"goto"   ,"package"   ,"synchronized"
+    ,"boolean"   ,"do"   ,"if"   ,"private"   ,"this"
+    ,"break"   ,"double"   ,"implements"   ,"protected"   ,"throw"
+    ,"byte"   ,"else"   ,"import"   ,"public"   ,"throws"
+    ,"case"   ,"enum"   ,"instanceof"   ,"return"   ,"transient"
+    ,"catch"   ,"extends"   ,"int"   ,"short"   ,"try"
+    ,"char"   ,"final"   ,"interface"   ,"static"   ,"void"
+    ,"class"   ,"finally"   ,"long"   ,"strictfp"   ,"volatile"
+    ,"const"   ,"float"   ,"native"   ,"super"   ,"while"
+    ]
+
+getRuleName z = if x `elem` ("grammar" : javaReserved) then z ++ "_" else z
+                where x = firstLowerCase z
+
+getLabelName = mkName ["Rule"] CamelCase
+
+getLastInPackage :: String -> String
+getLastInPackage =
+    last . words . map (\c -> if c == '.' then ' ' else c)
diff --git a/src/BNFC/Backend/Latex.hs b/src/BNFC/Backend/Latex.hs
--- a/src/BNFC/Backend/Latex.hs
+++ b/src/BNFC/Backend/Latex.hs
@@ -14,20 +14,24 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 module BNFC.Backend.Latex where
 
+import Data.List
+import Data.Monoid
+import System.FilePath ((<.>),replaceExtension)
+import Text.Printf
+
 import AbsBNF (Reg (..))
 import BNFC.Options hiding (Backend)
 import BNFC.Backend.Base
 import BNFC.Backend.Common.Makefile as Makefile
 import BNFC.CF
 import BNFC.Utils
-import Data.List
-import System.FilePath ((<.>),replaceExtension)
-import Text.Printf
+import BNFC.PrettyPrint hiding ((<.>), empty)
 
+-- | Entry point: create .tex file and a Makefile to compile it.
 makeLatex :: SharedOptions -> CF -> Backend
 makeLatex opts cf = do
     let texfile = name <.> "tex"
@@ -35,71 +39,82 @@
     Makefile.mkMakefile opts (makefile texfile)
   where name = lang opts
 
-cfToLatex :: String -> CF -> String
-cfToLatex name cf = unlines [
-                            "\\batchmode",
-                            beginDocument name,
-                            macros,
-                            introduction,
-                            prtTerminals name cf,
-                            prtBNF name cf,
-                            endDocument
-                            ]
-
-
-makefile_ = makefile
-makefile :: String -> String
-makefile texfile =
-      Makefile.mkRule "all" [pdffile]
-      []
-    $ Makefile.mkRule pdffile [texfile]
-      [ printf "pdflatex %s" texfile ]
-    $ Makefile.mkRule "clean" []
-      [ unwords [ "-rm", pdffile, auxfile, logfile ]]
-    $ Makefile.mkRule "cleanall" ["clean"]
-      [ "-rm Makefile " ++ texfile ]
-    ""
+-- | Create a makefile for the given tex file
+--
+-- >>> makefile "myFile.tex"
+-- all: myFile.pdf
+-- <BLANKLINE>
+-- myFile.pdf: myFile.tex
+-- 	pdflatex myFile.tex
+-- <BLANKLINE>
+-- clean:
+-- 	-rm myFile.pdf myFile.aux myFile.log
+-- <BLANKLINE>
+-- cleanall: clean
+-- 	-rm Makefile myFile.tex
+-- <BLANKLINE>
+makefile :: String -> Doc
+makefile texfile = vcat
+    [ Makefile.mkRule "all" [pdffile]
+        []
+    , Makefile.mkRule pdffile [texfile]
+        [ printf "pdflatex %s" texfile ]
+    , Makefile.mkRule "clean" []
+        [ unwords [ "-rm", pdffile, auxfile, logfile ]]
+    , Makefile.mkRule "cleanall" ["clean"]
+        [ "-rm Makefile " ++ texfile ]
+    ]
   where pdffile = replaceExtension texfile "pdf"
         auxfile = replaceExtension texfile "aux"
         logfile = replaceExtension texfile "log"
 
+-- | Create content of .tex file.
+cfToLatex :: String -> CF -> String
+cfToLatex name cf = unlines
+  -- Overall structure of created LaTeX document:
+  [ "\\batchmode"
+  , beginDocument name
+  , macros
+  , introduction
+  , prtTerminals name cf
+  , prtBNF name cf
+  , endDocument
+  ]
+
 introduction :: String
-introduction = concat
-               [
-               "\nThis document was automatically generated by ",
-               "the {\\em BNF-Converter}.",
-               " It was generated together with the lexer, the parser, and the",
-               " abstract syntax module, which guarantees that the document",
-               " matches with the implementation of the language (provided no",
-               " hand-hacking has taken place).\n"
-               ]
+introduction = unlines
+  [ "This document was automatically generated by the {\\em BNF-Converter}."
+  , "It was generated together with the lexer, the parser, and the"
+  , "abstract syntax module, which guarantees that the document"
+  , "matches with the implementation of the language"
+  , "(provided no hand-hacking has taken place)."
+  ]
 
 prtTerminals :: String -> CF -> String
-prtTerminals name cf = unlines [
-                               "\\section*{The lexical structure of " ++ name ++ "}",
-                               identSection cf,
-                               "\\subsection*{Literals}",
-                               prtLiterals name cf,
-                               unlines (map prtOwnToken (tokenPragmas cf)),
-                               "\\subsection*{Reserved words and symbols}",
-                               prtReserved name cf,
-                               prtSymb name cf,
-                               "\\subsection*{Comments}",
-                               prtComments $ comments cf
-                               ]
+prtTerminals name cf = unlines $
+  [ "\\section*{The lexical structure of " ++ name ++ "}"
+  , ""
+  ] ++ identSection cf ++
+  [ "\\subsection*{Literals}"
+  , prtLiterals name cf
+  ] ++ map prtOwnToken (tokenPragmas cf) ++
+  [ "\\subsection*{Reserved words and symbols}"
+  , prtReserved name cf
+  , prtSymb name cf
+  , "\\subsection*{Comments}"
+  , prtComments $ comments cf
+  ]
 
-identSection cf = if not (hasIdent cf) then [] else
-                    unlines [
-                               "\\subsection*{Identifiers}",
-                               prtIdentifiers
-                          ]
+identSection :: CF -> [String]
+identSection cf
+  | hasIdent cf = [ "\\subsection*{Identifiers}" ] ++ prtIdentifiers
+  | otherwise   = []
 
-prtIdentifiers :: String
-prtIdentifiers = unlines
-  [
-   "Identifiers \\nonterminal{Ident} are unquoted strings beginning with a letter,",
-   "followed by any combination of letters, digits, and the characters {\\tt \\_ '},",
-   "reserved words excluded."
+prtIdentifiers :: [String]
+prtIdentifiers =
+  [ "Identifiers \\nonterminal{Ident} are unquoted strings beginning with a letter,"
+  , "followed by any combination of letters, digits, and the characters {\\tt \\_ '},"
+  , "reserved words excluded."
   ]
 
 prtLiterals :: String -> CF -> String
@@ -136,17 +151,14 @@
   ]
 
 prtComments :: ([(String,String)],[String]) -> String
-prtComments (xs,ys) = concat
-                   [
-                   if null ys then
-                    "There are no single-line comments in the grammar. \\\\"
-                   else
-                    "Single-line comments begin with " ++ sing ++". \\\\",
-                   if null xs then
-                    "There are no multiple-line comments in the grammar."
-                   else
-                   "Multiple-line comments are  enclosed with " ++ mult ++"."
-                   ]
+prtComments (xs,ys) =
+    (if null ys
+        then "There are no single-line comments in the grammar. \\\\"
+        else "Single-line comments begin with " ++ sing ++". \\\\")
+    ++
+    (if null xs
+        then "There are no multiple-line comments in the grammar."
+        else "Multiple-line comments are  enclosed with " ++ mult ++".")
  where
  sing = intercalate ", " $ map (symbol.prt) ys
  mult = intercalate ", " $
@@ -155,7 +167,7 @@
                       symbol (prt y)) xs
 
 prtSymb :: String -> CF -> String
-prtSymb name cf = case symbols cf of
+prtSymb name cf = case cfgSymbols cf of
                    [] -> "\nThere are no symbols in " ++ name ++ ".\\\\\n"
                    xs -> "The symbols used in " ++ name ++ " are the following: \\\\\n"
                          ++
@@ -181,29 +193,30 @@
                   "\n\n",
                   "The reserved words used in " ++ name ++ " are the following: \\\\\n"]
 
-three :: [String] -> [[String]]
+-- | Group a list into blocks of 3 elements.
+three :: Monoid a => [a] -> [[a]]
 three []         = []
-three [x]        = [[x,[],[]]]
-three [x,y]      = [[x,y,[]]]
+three [x]        = [[x,mempty,mempty]]
+three [x,y]      = [[x,y,mempty]]
 three (x:y:z:xs) = [x,y,z] : three xs
 
 prtBNF :: String -> CF -> String
-prtBNF name cf = unlines [
-                     "\\section*{The syntactic structure of " ++ name ++"}",
-                     "Non-terminals are enclosed between $\\langle$ and $\\rangle$. ",
-                     "The symbols " ++ arrow ++ " (production), " ++
-                      delimiter ++" (union) ",
-                     "and " ++ empty ++ " (empty rule) belong to the BNF notation. ",
-                     "All other symbols are terminals.\\\\",
-                     prtRules (ruleGroups cf)
-                     ]
+prtBNF name cf = unlines
+  [ "\\section*{The syntactic structure of " ++ name ++ "}"
+  , ""
+  , "Non-terminals are enclosed between $\\langle$ and $\\rangle$. "
+  , "The symbols " ++ arrow ++ " (production), " ++ delimiter ++ " (union) "
+  , "and " ++ empty ++ " (empty rule) belong to the BNF notation. "
+  , "All other symbols are terminals.\\\\"
+  , prtRules (ruleGroups cf)
+  ]
 
 prtRules :: [(Cat,[Rule])] -> String
 prtRules          [] = []
 prtRules ((c,[]):xs)
     = tabular 3 [[nonterminal c,arrow,[]]] ++ prtRules xs
 prtRules ((c, r : rs) : xs)
-    = tabular 3 ([[nonterminal c,arrow,prtSymbols $ rhsRule r]] ++
+    = tabular 3 ([nonterminal c,arrow,prtSymbols $ rhsRule r] :
                  [[[],delimiter,prtSymbols (rhsRule y)] | y <-  rs]) ++
       prtRules xs
 
@@ -224,15 +237,16 @@
         escape c                                  = [c]
 
 macros :: String
-macros =
- "\\newcommand{\\emptyP}{\\mbox{$\\epsilon$}}" ++++
- "\\newcommand{\\terminal}[1]{\\mbox{{\\texttt {#1}}}}" ++++
- "\\newcommand{\\nonterminal}[1]{\\mbox{$\\langle \\mbox{{\\sl #1 }} \\! \\rangle$}}" ++++
- "\\newcommand{\\arrow}{\\mbox{::=}}" ++++
- "\\newcommand{\\delimit}{\\mbox{$|$}}" ++++
- "\\newcommand{\\reserved}[1]{\\mbox{{\\texttt {#1}}}}" ++++
- "\\newcommand{\\literal}[1]{\\mbox{{\\texttt {#1}}}}" ++++
- "\\newcommand{\\symb}[1]{\\mbox{{\\texttt {#1}}}}"
+macros = unlines
+  [ "\\newcommand{\\emptyP}{\\mbox{$\\epsilon$}}"
+  , "\\newcommand{\\terminal}[1]{\\mbox{{\\texttt {#1}}}}"
+  , "\\newcommand{\\nonterminal}[1]{\\mbox{$\\langle \\mbox{{\\sl #1 }} \\! \\rangle$}}"
+  , "\\newcommand{\\arrow}{\\mbox{::=}}"
+  , "\\newcommand{\\delimit}{\\mbox{$|$}}"
+  , "\\newcommand{\\reserved}[1]{\\mbox{{\\texttt {#1}}}}"
+  , "\\newcommand{\\literal}[1]{\\mbox{{\\texttt {#1}}}}"
+  , "\\newcommand{\\symb}[1]{\\mbox{{\\texttt {#1}}}}"
+  ]
 
 reserved :: String -> String
 reserved s = "{\\reserved{" ++ s ++ "}}"
@@ -269,37 +283,46 @@
 delimiter = " {\\delimit} "
 
 beginDocument :: String -> String
-beginDocument name =
- "%This Latex file is machine-generated by the BNF-converter\n" ++++
- "\\documentclass[a4paper,11pt]{article}" ++++
- "\\author{BNF-converter}" ++++
- "\\title{The Language " ++ name ++ "}" ++++
- -- "\\usepackage{isolatin1}" ++++
- "\\setlength{\\parindent}{0mm}" ++++
- "\\setlength{\\parskip}{1mm}" ++++
- "\\begin{document}\n" ++++
- "\\maketitle\n"
+beginDocument name = unlines
+ [ "%This Latex file is machine-generated by the BNF-converter"
+ , ""
+ , "\\documentclass[a4paper,11pt]{article}"
+ -- "\\usepackage{isolatin1}"
+ , "\\setlength{\\parindent}{0mm}"
+ , "\\setlength{\\parskip}{1mm}"
+ , ""
+ , "\\title{The Language " ++ name ++ "}"
+ , "\\author{BNF-converter}"
+ , ""
+ , "\\begin{document}"
+ , "\\maketitle"
+ , ""
+ ]
 
 endDocument :: String
-endDocument =
- "\n\\end{document}\n"
+endDocument = unlines
+  [ ""
+  , "\\end{document}"
+  ]
 
 latexRegExp :: Reg -> String
-latexRegExp = rex (0 :: Int) where
-  rex i e = case e of
-    RSeq reg0 reg  -> ifPar i 2 $ rex 2 reg0 +++ rex 2 reg
-    RAlt reg0 reg  -> ifPar i 1 $ rex 1 reg0 +++ "\\mid" +++ rex 1 reg
-    RMinus reg0 reg  -> ifPar i 1 $ rex 2 reg0 +++ "-" +++ rex 2 reg
-    RStar reg  -> rex 3 reg ++ "*"
-    RPlus reg  -> rex 3 reg ++ "+"
-    ROpt reg  -> rex 3 reg ++ "?"
-    REps  -> "\\epsilon"
-    RChar c  -> "\\mbox{`" ++ prt [c] ++ "'}"
-    RAlts str  -> "[" ++ "\\mbox{``" ++ prt str ++ "''}" ++ "]"
-    RSeqs str  -> "\\{" ++ "\\mbox{``" ++ prt str ++ "''}" ++ "\\}"
-    RDigit  -> "{\\nonterminal{digit}}"
-    RLetter  -> "{\\nonterminal{letter}}"
-    RUpper  -> "{\\nonterminal{upper}}"
-    RLower  -> "{\\nonterminal{lower}}"
-    RAny  -> "{\\nonterminal{anychar}}"
+latexRegExp = rex 0
+  where
+  rex :: Int -> Reg -> String
+  rex i = \case
+    RSeq r0 r   -> ifPar i 2 $ rex 2 r0 +++ rex 2 r
+    RAlt r0 r   -> ifPar i 1 $ rex 1 r0 +++ "\\mid" +++ rex 1 r
+    RMinus r0 r -> ifPar i 1 $ rex 2 r0 +++ "-" +++ rex 2 r
+    RStar r     -> rex 3 r ++ "*"
+    RPlus r     -> rex 3 r ++ "+"
+    ROpt r      -> rex 3 r ++ "?"
+    REps        -> "\\epsilon"
+    RChar c     -> "\\mbox{`" ++ prt [c] ++ "'}"
+    RAlts s     -> "[" ++ "\\mbox{``" ++ prt s ++ "''}" ++ "]"
+    RSeqs s     -> "\\{" ++ "\\mbox{``" ++ prt s ++ "''}" ++ "\\}"
+    RDigit      -> "{\\nonterminal{digit}}"
+    RLetter     -> "{\\nonterminal{letter}}"
+    RUpper      -> "{\\nonterminal{upper}}"
+    RLower      -> "{\\nonterminal{lower}}"
+    RAny        -> "{\\nonterminal{anychar}}"
   ifPar i j s = if i > j then "(" ++ s ++ ")" else s
diff --git a/src/BNFC/Backend/OCaml.hs b/src/BNFC/Backend/OCaml.hs
--- a/src/BNFC/Backend/OCaml.hs
+++ b/src/BNFC/Backend/OCaml.hs
@@ -14,7 +14,7 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 -- based on BNFC Haskell backend
@@ -22,23 +22,22 @@
 
 module BNFC.Backend.OCaml (makeOCaml) where
 
-import Text.PrettyPrint (render)
+import System.FilePath (pathSeparator, (</>))
 
-import BNFC.CF
 import BNFC.Backend.Base hiding (Backend)
 import BNFC.Backend.Common.Makefile
-import BNFC.Backend.OCaml.CFtoOCamlYacc
-import BNFC.Backend.OCaml.CFtoOCamlLex
 import BNFC.Backend.OCaml.CFtoOCamlAbs
-import BNFC.Backend.OCaml.CFtoOCamlTemplate
+import BNFC.Backend.OCaml.CFtoOCamlLex
 import BNFC.Backend.OCaml.CFtoOCamlPrinter
 import BNFC.Backend.OCaml.CFtoOCamlShow
+import BNFC.Backend.OCaml.CFtoOCamlTemplate
 import BNFC.Backend.OCaml.CFtoOCamlTest
+import BNFC.Backend.OCaml.CFtoOCamlYacc
 import BNFC.Backend.XML
-import BNFC.Utils
+import BNFC.CF
 import BNFC.Options
-
-import System.FilePath (pathSeparator, (</>))
+import BNFC.PrettyPrint
+import BNFC.Utils
 
 -- naming conventions
 
@@ -94,8 +93,8 @@
     mkfile (templateFile opts) $ cf2Template (templateFileM opts) absMod cf
     mkfile (printerFile opts)  $ cf2Printer prMod absMod cf
     mkfile (showFile opts)  $ cf2show showMod absMod cf
-    mkfile (tFile opts) $ render $ ocamlTestfile absMod lexMod parMod prMod showMod cf
-    mkfile (utilFile opts)      $ utilM
+    mkfile (tFile opts) $ ocamlTestfile absMod lexMod parMod prMod showMod cf
+    mkfile (utilFile opts) utilM
     mkMakefile opts $ makefile opts
     case xml opts of
       2 -> makeXML opts True cf
@@ -103,7 +102,7 @@
       _ -> return ()
 
 pkgToDir :: String -> FilePath
-pkgToDir s = replace '.' pathSeparator s
+pkgToDir = replace '.' pathSeparator
 
 codeDir :: SharedOptions -> FilePath
 codeDir opts = let pref = maybe "" pkgToDir (inPackage opts)
@@ -111,34 +110,38 @@
                    sep = if null pref || null dir then "" else [pathSeparator]
                  in pref ++ sep ++ dir
 
-makefile :: SharedOptions -> String
-makefile opts =
-    mkRule "all" []
-      [ "ocamlyacc " ++ ocamlyaccFile opts
-      , "ocamllex "  ++ ocamllexFile opts
-      , "ocamlc -o " ++ mkFile withLang "Test" "" opts +++
-                        utilFile opts +++
-                        absFile opts +++ templateFile opts +++
-                        showFile opts +++ printerFile opts +++
-                        mkFile withLang "Par" "mli" opts +++
-                        mkFile withLang "Par" "ml" opts +++
-                        mkFile withLang "Lex" "ml" opts +++
-                        tFile opts ]
-  $ mkRule "clean" []
-      [ "-rm -f " ++ unwords (map (dir++) [ "*.cmi", "*.cmo", "*.o" ]) ]
-  $ mkRule "distclean" ["clean"]
-      [ "-rm -f " ++ unwords [ mkFile withLang "Lex" "*" opts,
-                               mkFile withLang "Par" "*" opts,
-                               mkFile withLang "Layout" "*" opts,
-                               mkFile withLang "Skel" "*" opts,
-                               mkFile withLang "Print" "*" opts,
-                               mkFile withLang "Show" "*" opts,
-                               mkFile withLang "Test" "*" opts,
-                               mkFile withLang "Abs" "*" opts,
-                               mkFile withLang "Test" "" opts,
-                               utilFile opts,
-                               "Makefile*" ]]
-  ""
+makefile :: SharedOptions -> Doc
+makefile opts = vcat
+    [ mkVar "OCAMLC" "ocamlc"
+    , mkVar "OCAMLYACC" "ocamlyacc"
+    , mkVar "OCAMLLEX" "ocamllex"
+    , mkVar "OCAMLCFLAGS" ""
+    , mkRule "all" []
+        [ "$(OCAMLYACC) " ++ ocamlyaccFile opts
+        , "$(OCAMLLEX) "  ++ ocamllexFile opts
+        , "$(OCAMLC) $(OCAMLCFLAGS) -o " ++ mkFile withLang "Test" "" opts +++
+                          utilFile opts +++
+                          absFile opts +++ templateFile opts +++
+                          showFile opts +++ printerFile opts +++
+                          mkFile withLang "Par" "mli" opts +++
+                          mkFile withLang "Par" "ml" opts +++
+                          mkFile withLang "Lex" "ml" opts +++
+                          tFile opts ]
+    , mkRule "clean" []
+        [ "-rm -f " ++ unwords (map (dir++) [ "*.cmi", "*.cmo", "*.o" ]) ]
+    , mkRule "distclean" ["clean"]
+        [ "-rm -f " ++ unwords [ mkFile withLang "Lex" "*" opts,
+                                 mkFile withLang "Par" "*" opts,
+                                 mkFile withLang "Layout" "*" opts,
+                                 mkFile withLang "Skel" "*" opts,
+                                 mkFile withLang "Print" "*" opts,
+                                 mkFile withLang "Show" "*" opts,
+                                 mkFile withLang "Test" "*" opts,
+                                 mkFile withLang "Abs" "*" opts,
+                                 mkFile withLang "Test" "" opts,
+                                 utilFile opts,
+                                 "Makefile*" ]]
+    ]
   where dir = let d = codeDir opts in if null d then "" else d ++ [pathSeparator]
 
 utilM :: String
@@ -150,4 +153,3 @@
      "(* this should really be in the parser, but ocamlyacc won't put it in the .mli *)",
      "exception Parse_error of Lexing.position * Lexing.position"
     ]
-
diff --git a/src/BNFC/Backend/OCaml/CFtoOCamlAbs.hs b/src/BNFC/Backend/OCaml/CFtoOCamlAbs.hs
--- a/src/BNFC/Backend/OCaml/CFtoOCamlAbs.hs
+++ b/src/BNFC/Backend/OCaml/CFtoOCamlAbs.hs
@@ -14,7 +14,7 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 -- based on BNFC Haskell backend
diff --git a/src/BNFC/Backend/OCaml/CFtoOCamlLex.hs b/src/BNFC/Backend/OCaml/CFtoOCamlLex.hs
--- a/src/BNFC/Backend/OCaml/CFtoOCamlLex.hs
+++ b/src/BNFC/Backend/OCaml/CFtoOCamlLex.hs
@@ -1,3 +1,5 @@
+{-# LANGUAGE NoImplicitPrelude #-}
+
 {-
     BNF Converter: ocamllex Generator
     Copyright (C) 2005  Author:  Kristofer Johannisson
@@ -14,7 +16,7 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 
@@ -22,6 +24,8 @@
 
 module BNFC.Backend.OCaml.CFtoOCamlLex (cf2ocamllex) where
 
+import Prelude'
+
 import Control.Arrow ((&&&))
 import Data.List
 import Data.Char
@@ -31,7 +35,7 @@
 import BNFC.CF
 import AbsBNF
 import BNFC.Backend.OCaml.CFtoOCamlYacc (terminal)
-import BNFC.Utils ((+++))
+import BNFC.Utils ((+++), cstring, cchar)
 
 cf2ocamllex :: String -> String -> CF -> String
 cf2ocamllex _ parserMod cf =
@@ -64,11 +68,9 @@
   "        if i < 0 then l else exp (i - 1) (s.[i] :: l) in",
   "      exp (String.length s - 1) []",
   "  in let implode (l : char list) : string =",
-  "      let res = String.create (List.length l) in",
-  "      let rec imp i = function",
-  "      | [] -> res",
-  "      | c :: l -> res.[i] <- c; imp (i + 1) l in",
-  "      imp 0 l",
+  "      let res = Buffer.create (List.length l) in",
+  "      List.iter (Buffer.add_char res) l;",
+  "      Buffer.contents res",
   "  in implode (unesc (List.tl (explode s)))",
   "",
   "let incr_lineno (lexbuf:Lexing.lexbuf) : unit =",
@@ -82,7 +84,7 @@
 
 -- | set up hashtables for reserved symbols and words
 hashtables :: CF -> String
-hashtables cf = ht "symbol_table" (symbols cf )  ++ "\n" ++
+hashtables cf = ht "symbol_table" (cfgSymbols cf )  ++ "\n" ++
                 ht "resword_table" (reservedWords cf)
     where ht _ syms | null syms = ""
           ht table syms = unlines [
@@ -116,7 +118,7 @@
 
 rMacros :: CF -> [String]
 rMacros cf =
-  let symbs = symbols cf
+  let symbs = cfgSymbols cf
   in
   (if null symbs then [] else [
    "let rsyms =    (* reserved words consisting of special symbols *)",
@@ -135,9 +137,9 @@
 userTokens cf =
   let regName = map toLower . show in
   [(regName name, printRegOCaml reg, show name) | (name, reg) <- tokenPragmas cf]
-      
 
 
+
 -- | Make OCamlLex rule
 -- >>> mkRule "token" [("REGEX1","ACTION1"),("REGEX2","ACTION2"),("...","...")]
 -- rule token =
@@ -160,13 +162,17 @@
 -- | Create regex for single line comments
 -- >>> mkRegexSingleLineComment "--"
 -- "--" (_ # '\n')*
+-- >>> mkRegexSingleLineComment "\""
+-- "\"" (_ # '\n')*
 mkRegexSingleLineComment :: String -> Doc
-mkRegexSingleLineComment s =
-    doubleQuotes (text s) <+> "(_ # '\\n')*"
+mkRegexSingleLineComment s = cstring s <+> "(_ # '\\n')*"
 
 -- | Create regex for multiline comments
 -- >>> mkRegexMultilineComment "<!--" "-->"
 -- "<!--" ((u # ['-']) | '-' (u # ['-']) | "--" (u # ['>']))* '-'* "-->"
+--
+-- >>> mkRegexMultilineComment "\"'" "'\""
+-- "\"'" ((u # ['\'']) | '\'' (u # ['"']))* '\''* "'\""
 mkRegexMultilineComment :: String -> String -> Doc
 mkRegexMultilineComment b e =
   lit b
@@ -176,8 +182,8 @@
   where
     lit :: String -> Doc
     lit "" = empty
-    lit [c] = quotes (char c)
-    lit s = doubleQuotes (text s)
+    lit [c] = cchar c
+    lit s = cstring s
     prefix = map (init &&& last) (drop 1 (inits e))
     subregexs = [ lit ss <+> parens ("u #" <+> brackets (lit [s])) | (ss,s) <- prefix]
 
@@ -189,15 +195,16 @@
     ++
     [ (mkRegexMultilineComment b e, "token lexbuf") | (b,e) <- multilineC]
     ++
+    -- reserved keywords
+    [ ( "rsyms"
+      , "let id = lexeme lexbuf in try Hashtbl.find symbol_table id with Not_found -> failwith (\"internal lexer error: reserved symbol \" ^ id ^ \" not found in hashtable\")" )
+      | not (null (cfgSymbols cf))]
+    ++
     -- user tokens
     [ (text n , tokenAction (text t)) | (n,_,t) <- userTokens cf]
     ++
     -- predefined tokens
     [ ( "l i*", tokenAction "Ident" ) ]
-    ++
-    [ ( "rsyms"
-      , "let id = lexeme lexbuf in try Hashtbl.find symbol_table id with Not_found -> failwith (\"internal lexer error: reserved symbol \" ^ id ^ \" not found in hashtable\")" )
-      | not (null (symbols cf))]
     ++
     -- integers
     [ ( "d+", "let i = lexeme lexbuf in TOK_Integer (int_of_string i)" )
diff --git a/src/BNFC/Backend/OCaml/CFtoOCamlPrinter.hs b/src/BNFC/Backend/OCaml/CFtoOCamlPrinter.hs
--- a/src/BNFC/Backend/OCaml/CFtoOCamlPrinter.hs
+++ b/src/BNFC/Backend/OCaml/CFtoOCamlPrinter.hs
@@ -1,3 +1,5 @@
+{-# LANGUAGE NoImplicitPrelude #-}
+
 {-
     BNF Converter: Pretty-printer generator
     Copyright (C) 2005  Author:  Kristofer Johannisson
@@ -14,17 +16,21 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 -- based on BNFC Haskell backend
 
 module BNFC.Backend.OCaml.CFtoOCamlPrinter (cf2Printer) where
 
+import Prelude'
+
+import Data.Char(toLower)
+import Data.List (intersperse, sortBy)
+import Data.Maybe (fromJust)
+
 import BNFC.CF
 import BNFC.Utils
-import Data.List (intersperse, sortBy)
-import Data.Char(toLower)
 import BNFC.Backend.OCaml.OCamlUtil
 import BNFC.PrettyPrint
 import BNFC.Backend.Haskell.CFtoPrinter (compareRules)
@@ -66,10 +72,7 @@
   "",
   "let indent_width = 4",
   "",
-  "let indent (i: int) : string = ",
-  "    let s = String.make (i+1) ' ' in",
-  "    String.set s 0 '\\n';",
-  "    s",
+  "let indent (i: int) : string = \"\\n\" ^ String.make i ' '",
   "",
   "(* this render function is written for C-style languages, you may want to change it *)",
   "let render (s : string) : doc = fun buf i -> ",
@@ -147,10 +150,6 @@
  where
    reserved = "i":"e":reservedOCaml
    toArgs (cons,args) = ((cons, mkNames reserved LowerCase (map var args)), ruleOf cons)
-   names [] _ = []
-   names (x:xs) n
-     | elem x xs = (x ++ show n) : names xs (n+1)
-     | otherwise = x             : names xs n
    var (ListCat c)  = var c ++ "s"
    var (Cat "Ident")   = "id"
    var (Cat "Integer") = "n"
@@ -158,10 +157,7 @@
    var (Cat "Char")    = "c"
    var (Cat "Double")  = "d"
    var xs        = map toLower (show xs)
-   checkRes s
-        | elem s reservedOCaml = s ++ "'"
-        | otherwise              = s
-   ruleOf s = maybe undefined id $ lookupRule s (rulesOfCF cf)
+   ruleOf s = fromJust $ lookupRule s (cfgRules cf)
 
 --- case_fun :: Cat -> [(Constructor,Rule)] -> String
 case_fun cat xs = unlines [
@@ -196,18 +192,25 @@
 
 
 -- | Pattern match on the list constructor and the coercion level
+--
 -- >>> mkPrtListCase (Rule "[]" (ListCat (Cat "Foo")) [])
 -- (_,[]) -> (concatD [])
+--
 -- >>> mkPrtListCase (Rule "(:[])" (ListCat (Cat "Foo")) [Left (Cat "Foo")])
 -- (_,[x]) -> (concatD [prtFoo 0 x])
+--
 -- >>> mkPrtListCase (Rule "(:)" (ListCat (Cat "Foo")) [Left (Cat "Foo"), Left (ListCat (Cat "Foo"))])
 -- (_,x::xs) -> (concatD [prtFoo 0 x ; prtFooListBNFC 0 xs])
+--
 -- >>> mkPrtListCase (Rule "[]" (ListCat (CoercCat "Foo" 2)) [])
 -- (2,[]) -> (concatD [])
+--
 -- >>> mkPrtListCase (Rule "(:[])" (ListCat (CoercCat "Foo" 2)) [Left (CoercCat "Foo" 2)])
 -- (2,[x]) -> (concatD [prtFoo 2 x])
+--
 -- >>> mkPrtListCase (Rule "(:)" (ListCat (CoercCat "Foo" 2)) [Left (CoercCat "Foo" 2), Left (ListCat (CoercCat "Foo" 2))])
 -- (2,x::xs) -> (concatD [prtFoo 2 x ; prtFooListBNFC 2 xs])
+--
 mkPrtListCase :: Rule -> Doc
 mkPrtListCase (Rule f (ListCat c) rhs)
   | isNilFun f  = parens (precPattern <> "," <> "[]") <+> "->" <+> body
@@ -217,6 +220,7 @@
   where
     precPattern = case precCat c of 0 -> "_" ; p -> integer p
     body = text $ mkRhs ["x", "xs"] rhs
+mkPrtListCase _ = error "mkPrtListCase undefined for non-list categories"
 
 mkRhs args its =
   "(concatD [" ++ unwords (intersperse ";" (mk args its)) ++ "])"
@@ -230,4 +234,3 @@
 prtFun :: Cat -> String
 prtFun (ListCat c) = prtFun c ++ "ListBNFC"
 prtFun c = "prt" ++ fixTypeUpper (normCat c)
-
diff --git a/src/BNFC/Backend/OCaml/CFtoOCamlShow.hs b/src/BNFC/Backend/OCaml/CFtoOCamlShow.hs
--- a/src/BNFC/Backend/OCaml/CFtoOCamlShow.hs
+++ b/src/BNFC/Backend/OCaml/CFtoOCamlShow.hs
@@ -14,7 +14,7 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 -- there is no "deriving Show" in OCaml, although there are solutions based
@@ -23,10 +23,12 @@
 
 module BNFC.Backend.OCaml.CFtoOCamlShow (cf2show) where
 
+import Data.Char(toLower)
+import Data.List (intersperse)
+import Data.Maybe (fromJust)
+
 import BNFC.CF
 import BNFC.Utils
-import Data.List (intersperse)
-import Data.Char(toLower)
 import BNFC.Backend.OCaml.OCamlUtil
 
 cf2show :: String -> String -> CF -> String
@@ -115,7 +117,7 @@
    checkRes s
         | elem s reservedOCaml = s ++ "'"
         | otherwise              = s
-   ruleOf s = maybe undefined id $ lookupRule s (rulesOfCF cf)
+   ruleOf s = fromJust $ lookupRule s (cfgRules cf)
 
 --- case_fun :: Cat -> [(Constructor,Rule)] -> String
 case_fun cat xs = unlines [
@@ -144,4 +146,3 @@
 showsFun c = case c of
     ListCat t -> "showList" +++ showsFun t
     _ -> "show" ++ (fixTypeUpper $ normCat c)
-
diff --git a/src/BNFC/Backend/OCaml/CFtoOCamlTemplate.hs b/src/BNFC/Backend/OCaml/CFtoOCamlTemplate.hs
--- a/src/BNFC/Backend/OCaml/CFtoOCamlTemplate.hs
+++ b/src/BNFC/Backend/OCaml/CFtoOCamlTemplate.hs
@@ -14,7 +14,7 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 -- based on BNFC Haskell backend
@@ -68,4 +68,3 @@
  unlines $
          ["trans" ++ show cat ++ " (x : " ++ fixType cat ++ ") : result = match x with",
           unlines $ insertBar $ map (\s -> s ++ " -> " ++ "failure x") xs]
-
diff --git a/src/BNFC/Backend/OCaml/CFtoOCamlTest.hs b/src/BNFC/Backend/OCaml/CFtoOCamlTest.hs
--- a/src/BNFC/Backend/OCaml/CFtoOCamlTest.hs
+++ b/src/BNFC/Backend/OCaml/CFtoOCamlTest.hs
@@ -1,3 +1,5 @@
+{-# LANGUAGE NoImplicitPrelude #-}
+
 {-
     BNF Converter: Generate main/test module for OCaml
     Copyright (C) 2005  Author:  Kristofer Johannisson
@@ -14,11 +16,13 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 module BNFC.Backend.OCaml.CFtoOCamlTest where
 
+import Prelude'
+
 import Text.PrettyPrint
 
 import BNFC.CF
@@ -58,7 +62,7 @@
         , ";;"
         , ""
         , "let showTree (t : " <> topType <> ") : string ="
-        , nest 4 (fsep ( punctuate "^" 
+        , nest 4 (fsep ( punctuate "^"
             [ doubleQuotes "[Abstract syntax]\\n\\n"
             , showFun <+> "t"
             , doubleQuotes "\\n\\n"
@@ -89,5 +93,3 @@
         , ";;"
         , ""
         , "main ();;" ]
-
-
diff --git a/src/BNFC/Backend/OCaml/CFtoOCamlYacc.hs b/src/BNFC/Backend/OCaml/CFtoOCamlYacc.hs
--- a/src/BNFC/Backend/OCaml/CFtoOCamlYacc.hs
+++ b/src/BNFC/Backend/OCaml/CFtoOCamlYacc.hs
@@ -14,7 +14,7 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 -- based on BNFC Haskell backend
@@ -63,9 +63,9 @@
          ]
 
 definedRules :: CF -> String
-definedRules cf = unlines [mkDef f xs e | FunDef f xs e <- pragmasOfCF cf]
+definedRules cf = unlines [mkDef f xs e | FunDef f xs e <- cfgPragmas cf]
     where
-        mkDef f xs e = 
+        mkDef f xs e =
             "let " ++ f ++ " " ++ mkTuple xs ++ " = " ++ ocamlExp e
             where
                 ocamlExp :: Exp -> String
@@ -77,7 +77,7 @@
 
 declarations :: String -> CF -> String
 declarations absName cf = unlines
-    [tokens (symbols cf) (reservedWords cf),
+    [tokens (cfgSymbols cf) (reservedWords cf),
      specialTokens cf,
      entryPoints absName cf
     ]
@@ -96,7 +96,7 @@
 -- | map a CF terminal into a ocamlyacc token
 terminal :: CF -> String -> String
 terminal cf s  |  s `elem` reservedWords cf = "TOK_" ++ s
-terminal cf s  = case lookup s (zip (symbols cf) [1..]) of
+terminal cf s  = case lookup s (zip (cfgSymbols cf) [1..]) of
     Just i -> "SYMB" ++ show i
     Nothing -> error $ "CFtoOCamlYacc: terminal " ++ show s ++ " not defined in CF."
 
@@ -183,7 +183,7 @@
                  else (False,r0),
      let (p,m) = generatePatterns cf r])
  where
-   revs = reversibleCats cf
+   revs = cfgReversibleCats cf
    mkFlip doit xs = case xs of
        a:b:rest | doit -> b:a:rest
        _ -> xs
@@ -213,7 +213,7 @@
    revIf c m = if (not (isConsFun (funRule r)) && elem c revs)
                  then ("(List.rev " ++ m ++ ")")
                else m  -- no reversal in the left-recursive Cons rule itself
-   revs = reversibleCats cf
+   revs = cfgReversibleCats cf
 
 
 
@@ -235,6 +235,3 @@
                 -- PCC: take "own" as type name? (manual says newtype)
       where -- ignore position categories for now
          posn = "" -- if isPositionCat cf cat then "mkPosToken " else ""
-
-
-
diff --git a/src/BNFC/Backend/OCaml/OCamlUtil.hs b/src/BNFC/Backend/OCaml/OCamlUtil.hs
--- a/src/BNFC/Backend/OCaml/OCamlUtil.hs
+++ b/src/BNFC/Backend/OCaml/OCamlUtil.hs
@@ -14,7 +14,7 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 module BNFC.Backend.OCaml.OCamlUtil where
diff --git a/src/BNFC/Backend/Pygments.hs b/src/BNFC/Backend/Pygments.hs
--- a/src/BNFC/Backend/Pygments.hs
+++ b/src/BNFC/Backend/Pygments.hs
@@ -1,3 +1,5 @@
+{-# LANGUAGE NoImplicitPrelude #-}
+
 {- Generates a Pygments lexer from a BNF grammar.
  -
  - Resources:
@@ -7,6 +9,7 @@
  - -}
 module BNFC.Backend.Pygments where
 
+import Prelude'
 
 import AbsBNF (Reg(..))
 import BNFC.Backend.Base (mkfile, Backend)
@@ -20,8 +23,8 @@
 makePygments opts cf = do
     let lexerfile = render (lowerCase name <> "/__init__.py")
         setupfile = "setup.py"
-    mkfile lexerfile (render $ lexer name cf)
-    mkfile setupfile (render $ setup name)
+    mkfile lexerfile (lexer name cf)
+    mkfile setupfile (setup name)
   where name = lang opts
 
 setup :: String -> Doc
diff --git a/src/BNFC/Backend/Txt2Tag.hs b/src/BNFC/Backend/Txt2Tag.hs
--- a/src/BNFC/Backend/Txt2Tag.hs
+++ b/src/BNFC/Backend/Txt2Tag.hs
@@ -14,7 +14,7 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 module BNFC.Backend.Txt2Tag (cfToTxt)where
@@ -122,7 +122,7 @@
          map (\(x,y) -> symbol (prt x) ++ " and " ++ symbol (prt y)) xs
 
 prtSymb :: String -> CF -> String
-prtSymb name cf = case symbols cf of
+prtSymb name cf = case cfgSymbols cf of
                    [] -> "\nThere are no symbols in " ++ name ++ ".\n"
                    xs -> "The symbols used in " ++ name ++ " are the following:\n"
                          ++
diff --git a/src/BNFC/Backend/Utils.hs b/src/BNFC/Backend/Utils.hs
deleted file mode 100644
--- a/src/BNFC/Backend/Utils.hs
+++ /dev/null
@@ -1,21 +0,0 @@
--- | Functions that are used in multiple backends
-module BNFC.Backend.Utils (isTokenType) where
-
-import BNFC.CF (Cat(..))
-
--- | Checks if a category is a token type (either built-in or user-defined)
--- The first argument is the list of user-defined token type.
--- >>> isTokenType [] (Cat "Integer")
--- True
--- >>> isTokenType [Cat "Abc"] (Cat "Abc")
--- True
--- >>> isTokenType [] (Cat "Abc")
--- False
-isTokenType :: [Cat] -> Cat -> Bool
-isTokenType _ (Cat "Integer") = True
-isTokenType _ (Cat "Char") = True
-isTokenType _ (Cat "String") = True
-isTokenType _ (Cat "Double") = True
-isTokenType _ (Cat "Ident") = True
-isTokenType user cat | cat `elem` user = True
-isTokenType _ _ = False
diff --git a/src/BNFC/Backend/XML.hs b/src/BNFC/Backend/XML.hs
--- a/src/BNFC/Backend/XML.hs
+++ b/src/BNFC/Backend/XML.hs
@@ -14,7 +14,7 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 module BNFC.Backend.XML ---- (cf2DTD, cf2XML)
@@ -28,7 +28,7 @@
 import BNFC.Backend.Haskell.HsOpts (xmlFile, xmlFileM, absFileM)
 import Data.List (intersperse, intercalate)
 import Data.Char(toLower)
-import Data.Maybe (fromMaybe)
+import Data.Maybe (fromJust)
 
 type Coding = Bool ---- change to at least three values
 
@@ -137,6 +137,7 @@
 -- derive an XML printer from a BNF grammar
 cf2XMLPrinter :: Bool -> SharedOptions -> String -> CF -> String
 cf2XMLPrinter typ opts absMod cf = unlines [
+  pragmas opts,
   prologue typ opts absMod,
   integerRule cf,
   doubleRule cf,
@@ -146,6 +147,11 @@
   rules cf
   ]
 
+pragmas :: SharedOptions -> String
+pragmas opts =
+  if target opts == TargetHaskellGadt
+  then "{-# LANGUAGE TypeSynonymInstances, FlexibleInstances, GADTs #-}"
+  else ""
 
 prologue :: Bool -> SharedOptions -> String -> String
 prologue b opts _ = unlines [
@@ -218,7 +224,7 @@
    reservedHaskell = ["case","class","data","default","deriving","do","else","if",
                           "import","in","infix","infixl","infixr","instance","let","module",
                           "newtype","of","then","type","where","as","qualified","hiding"]
-   ruleOf s = fromMaybe undefined $ lookupRule s (rulesOfCF cf)
+   ruleOf s = fromJust $ lookupRule s (cfgRules cf)
 
 --- case_fun :: Cat -> [(Constructor,Rule)] -> String
 case_fun cat xs = unlines [
diff --git a/src/BNFC/CF.hs b/src/BNFC/CF.hs
--- a/src/BNFC/CF.hs
+++ b/src/BNFC/CF.hs
@@ -1,7 +1,7 @@
 {-# LANGUAGE PatternGuards, DeriveFunctor #-}
 {-
     BNF Converter: Abstract syntax
-    Copyright (C) 2004  Author:  Markus Forberg, Michael Pellauer, Aarne Ranta
+    Copyright (C) 2004  Author:  Markus Forsberg, Michael Pellauer, Aarne Ranta
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -15,13 +15,13 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 module BNFC.CF (
             -- Types.
             CF,
-            CFG(..), pragmasOfCF, -- ...
+            CFG(..),
             Rule, Rul(..), lookupRule,
             Pragma(..),
             Exp(..),
@@ -53,13 +53,10 @@
             allEntryPoints,
             reservedWords,
             cfTokens,
-            symbols,
             literals,
-            reversibleCats,
             findAllReversibleCats, -- find all reversible categories
             identCat,       -- transforms '[C]' to ListC (others, unchanged).
             isParsable,
-            rulesOfCF,      -- All rules of a grammar.
             rulesForCat,    -- rules for a given category
             rulesForNormalizedCat,    -- rules for a given category
             ruleGroups,     -- Categories are grouped with their rules.
@@ -69,6 +66,7 @@
 --            badInheritence, -- Returns a list of all function labels that can cause problems in languages with inheritence.
             isList,         -- Checks if a category is a list category.
             isTokenCat,
+            sameCat,
             -- Information functions for list functions.
             isNilFun,       -- empty list function? ([])
             isOneFun,       -- one element list function? (:[])
@@ -105,7 +103,6 @@
             cf2cfp,
             cfp2cf,
             trivialProf,
-            rulesOfCFP,
             funRuleP, ruleGroupsP, allCatsP, allEntryPointsP
            ) where
 
@@ -120,49 +117,56 @@
 import ErrM
 
 -- | A context free grammar consists of a set of rules and some extended
--- information (e.g. pragmas, literals, symbols, keywords)
+-- information (e.g. pragmas, literals, symbols, keywords).
+
 type CF = CFG Fun
 
 -- | A rule consists of a function name, a main category and a sequence of
 -- terminals and non-terminals.
--- function_name . Main_Cat ::= sequence
+-- @
+--   function_name . Main_Cat ::= sequence
+-- @
+
 type Rule = Rul Fun
 
--- | Polymorphic rule type for common type signatures for CF and CFP
-data Rul function = Rule { funRule :: function
-                           -- ^ The function (semantic action) of a
-                           -- rule. In order to be able to generate
-                           -- data types this must be a constructor
-                           -- (or an identity function).
-                         , valCat :: Cat -- ^ The value category
-                         , rhsRule :: [Either Cat String]
-                           -- ^ The list of Terminals/NonTerminals in
-                           -- the right-hand-side of a rule.
-                         }
-                deriving (Eq,Functor)
+-- | Polymorphic rule type for common type signatures for CF and CFP.
 
+data Rul function = Rule
+  { funRule :: function
+      -- ^ The function (semantic action) of a rule.
+      --   In order to be able to generate data types this must be a constructor
+      --   (or an identity function).
+  , valCat  :: Cat
+      -- ^ The value category, i.e., the defined non-terminal.
+  , rhsRule :: [Either Cat String]
+      -- ^ The sentential form, i.e.,
+      --   the list of (non)terminals in the right-hand-side of a rule.
+  } deriving (Eq, Functor)
+
 instance (Show function) => Show (Rul function) where
   show (Rule f cat rhs) =
       unwords (show f : "." : show cat : "::=" : map (either show id) rhs)
 
--- | Polymorphic CFG type for common type signatures for CF and CFP
-newtype CFG function = CFG { unCFG :: (Exts,[Rul function]) }
-                deriving (Functor)
+-- | Polymorphic CFG type for common type signatures for CF and CFP.
 
+data CFG function = CFG
+    { cfgPragmas        :: [Pragma]
+    , cfgLiterals       :: [Literal]  -- ^ @Char, String, Ident, Integer, Double@.
+                                      --   @String@s are quoted strings,
+                                      --   and @Ident@s are unquoted.
+    , cfgSymbols        :: [Symbol]   -- ^ Symbols in the grammar, e.g. “*”, '->'.
+    , cfgKeywords       :: [KeyWord]  -- ^ Reserved words, e.g. 'if' 'while'.
+    , cfgReversibleCats :: [Cat]      -- ^ Categories that can be made left-recursive.
+    , cfgRules          :: [Rul function]
+    } deriving (Functor)
 
+
 instance (Show function) => Show (CFG function) where
-  show (CFG (_,rules)) = unlines $ map show rules
+  show CFG{..} = unlines $ map show cfgRules
 
-type Exts = ([Pragma],Info)
 
--- | Info is information extracted from the CF, for easy access.
--- Literals - Char, String, Ident, Integer, Double
---            Strings are quoted strings, and Ident are unquoted.
--- Symbols  - symbols in the grammar, e.g. “*”, '->'.
--- KeyWord  - reserved words, e.g. 'if' 'while'
-type Info = ([Literal],[Symbol],[KeyWord],[Cat])
+-- | Expressions for function definitions.
 
--- Expressions for function definitions
 data Exp = App String [Exp]
          | LitInt Integer
          | LitDouble Double
@@ -198,7 +202,8 @@
                 | Right es <- listView e2   = Right $ e1:es
             listView x = Left x
 
--- | Pragmas
+-- | Pragmas.
+
 data Pragma = CommentS  String -- ^ for single line comments
             | CommentM (String,String) -- ^  for multiple-line comments.
             | TokenReg String Bool Reg -- ^ for tokens
@@ -212,14 +217,14 @@
 
 -- | User-defined regular expression tokens
 tokenPragmas :: CFG f -> [(Cat,Reg)]
-tokenPragmas cf = [(TokenCat name,e) | TokenReg name _ e <- pragmasOfCF cf]
+tokenPragmas cf = [ (TokenCat name, e) | TokenReg name _ e <- cfgPragmas cf ]
 
--- | The names of all user-defined tokens
+-- | The names of all user-defined tokens.
 tokenNames :: CFG f -> [String]
-tokenNames cf = map (show.fst) (tokenPragmas cf)
+tokenNames cf = map (show . fst) (tokenPragmas cf)
 
 layoutPragmas :: CF -> (Bool,[String],[String])
-layoutPragmas cf = let ps = pragmasOfCF cf in (
+layoutPragmas cf = let ps = cfgPragmas cf in (
   not (null [() | LayoutTop  <- ps]),   -- if there's layout betw top-level
   concat [ss | Layout ss     <- ps],    -- layout-block starting words
   concat [ss | LayoutStop ss <- ps]     -- layout-block ending words
@@ -239,30 +244,20 @@
 ------------------------------------------------------------------------------
 
 -- | Categories are the Non-terminals of the grammar.
-data Cat = InternalCat       -- | Internal category, inserted in 1st
-                             -- position in "internal" rules,
-                             -- essentially ensuring that they are
-                             -- never parsed.
-         | Cat String
-         | TokenCat String   -- ^ Token types (like Ident)
-         | ListCat Cat
-         | CoercCat String Integer
+data Cat
+  = InternalCat       -- ^ Internal category, inserted in 1st
+                      -- position in "internal" rules,
+                      -- essentially ensuring that they are never parsed.
+  | Cat String
+  | TokenCat String   -- ^ Token types (like @Ident@).
+  | ListCat Cat
+  | CoercCat String Integer
   deriving (Eq, Ord)
 
 -- An alias for Cat used in many backends:
 type NonTerminal = Cat
 
 -- | Render category symbols as strings
--- >>> catToStr (Cat "Def")
--- "Def"
--- >>> catToStr (ListCat (Cat "Thing"))
--- "[Thing]"
--- >>> catToStr (CoercCat "Expr" 3)
--- "Expr3"
--- >>> catToStr (ListCat (CoercCat "Expr" 2))
--- "[Expr2]"
--- >>> catToStr (TokenCat "Abc")
--- "Abc"
 catToStr InternalCat = "#"
 catToStr (Cat s) = s
 catToStr (TokenCat s) = s
@@ -272,16 +267,10 @@
 instance Show Cat where
   show = catToStr
 
--- | Reads a string into a category. This should only needs to handle
+-- | Reads a string into a category. This should only need to handle
 -- the case of simple categories (with or without coercion) since list
 -- categories are parsed in the grammar already. To be on the safe side here,
 -- we still call the parser function that parses categries.
--- >>> strToCat "Abc" == Cat "Abc"
--- True
--- >>> strToCat "Abc123" == CoercCat "Abc" 123
--- True
--- >>> strToCat "[Expr2]" == ListCat (CoercCat "Expr" 2)
--- True
 strToCat :: String -> Cat
 strToCat "#" = InternalCat
 strToCat s =
@@ -318,27 +307,20 @@
 isDataOrListCat (ListCat c)     = isDataOrListCat c
 isDataOrListCat _               = True
 
--- | Categories C1, C2,... (one digit in end) are variants of C. This function
+-- | Categories C1, C2,... (one digit at the end) are variants of C. This function
 -- returns true if two category are variants of the same abstract category.
 -- E.g.
 --
--- >>> eqCat (Cat "Abc") (Cat "Abc")
--- True
--- >>> eqCat (CoercCat "Abc" 3) (CoercCat "Abc" 5)
--- True
--- >>> eqCat (CoercCat "Acb" 4) (CoercCat "Abc" 4)
--- False
--- >>> eqCat (Cat "Abc") (CoercCat "Abc" 44)
+-- >>> sameCat (Cat "Abc") (CoercCat "Abc" 44)
 -- True
-eqCat :: Cat -> Cat -> Bool
-eqCat (CoercCat c1 _) (CoercCat c2 _) = c1 == c2
-eqCat (Cat c1 ) (CoercCat c2 _) = c1 == c2
-eqCat (CoercCat c1 _) (Cat c2) = c1 == c2
-eqCat c1 c2 = c1 == c2
 
-
+sameCat :: Cat -> Cat -> Bool
+sameCat (CoercCat c1 _) (CoercCat c2 _) = c1 == c2
+sameCat (Cat c1)        (CoercCat c2 _) = c1 == c2
+sameCat (CoercCat c1 _) (Cat c2)        = c1 == c2
+sameCat c1              c2              = c1 == c2
 
--- | Removes precendence information. C1 => C, [C2] => [C]
+-- | Removes precedence information. C1 => C, [C2] => [C]
 normCat :: Cat -> Cat
 normCat (ListCat c) = ListCat (normCat c)
 normCat (CoercCat c _) = Cat c
@@ -350,10 +332,6 @@
 -- | When given a list Cat, i.e. '[C]', it removes the square
 -- brackets, and adds the prefix List, i.e. 'ListC'.  (for Happy and
 -- Latex)
--- >>> identCat (ListCat (Cat "C")) -- [C]
--- "ListC"
--- >>> identCat (CoercCat "C" 3)
--- "C3"
 identCat :: Cat -> String
 identCat (ListCat c) = "List" ++ identCat c
 identCat c = show c
@@ -366,24 +344,20 @@
 isTokenCat (TokenCat _) = True
 isTokenCat _            = False
 
--- | Unwraps the list constructor from the category name. Eg. [C1] => C1
--- E.g.
--- >>> catOfList (ListCat (Cat "A"))
--- A
--- >>> catOfList (Cat "B")
--- B
+-- | Unwraps the list constructor from the category name.
+--   E.g. @[C1] => C1@.
 catOfList :: Cat -> Cat
 catOfList (ListCat c) = c
 catOfList c = c
+
 ------------------------------------------------------------------------------
 -- Functions
 ------------------------------------------------------------------------------
+
 -- | Fun is the function name of a rule.
 type Fun     = String
--- | Either Cat or Fun
 
-
--- | Is this function just a coercion? (Ie. the identity)
+-- | Is this function just a coercion? (I.e. the identity)
 isCoercion :: Fun -> Bool
 isCoercion = (== "_") -- perhaps this should be changed to "id"?
 
@@ -411,7 +385,9 @@
 isOneFun f  = f == "(:[])"
 isConsFun f = f == "(:)"
 isConcatFun f = f == "(++)"
+
 ------------------------------------------------------------------------------
+
 type Name = String
 
 -- | Abstract syntax tree.
@@ -420,34 +396,24 @@
 -- | The abstract syntax of a grammar.
 type Data = (Cat, [(Fun,[Cat])])
 
--- | firstCat returns the first Category appearing in the grammar.
+-- | @firstCat@ returns the first @Cat@egory appearing in the grammar.
 firstCat :: CF -> Cat
-firstCat = valCat . head . rulesOfCF
+firstCat = valCat . head . cfgRules
 
 firstEntry :: CF -> Cat
 firstEntry cf = case allEntryPoints cf of
                  (x:_) -> x
                  _     -> firstCat cf
 
-rulesOfCF   :: CFG f -> [Rul f]
-rulesOfCFP  :: CFP -> [RuleP]
-infoOfCF    :: CFG f -> Info
-pragmasOfCF :: CFG f -> [Pragma]
-
-rulesOfCF   = snd . unCFG
-rulesOfCFP  = rulesOfCF
-infoOfCF    = snd . fst . unCFG
-pragmasOfCF = fst . fst . unCFG
-
 -- aggressively ban nonunique names (AR 31/5/2012)
 
 notUniqueNames :: [Name] -> CF -> [Fun]
 notUniqueNames reserved cf = [head xs | xs <- xss, length xs > 1] where
   xss = group (sort names)
   names = reserved ++ allCatsIdNorm cf ++ allFuns cf
-  allFuns g = [ f | f <- map funRule (rulesOfCF g), not (isNilCons f || isCoercion f)]
+  allFuns g = [ f | f <- map funRule (cfgRules g), not (isNilCons f || isCoercion f)]
 
--- extract the comment pragmas.
+-- | Extract the comment pragmas.
 commentPragmas :: [Pragma] -> [Pragma]
 commentPragmas = filter isComment
  where isComment (CommentS _) = True
@@ -460,22 +426,22 @@
 
 -- | Returns all normal rules that constructs the given Cat.
 rulesForCat :: CF -> Cat -> [Rule]
-rulesForCat cf cat = [r | r <- rulesOfCF cf, isParsable r, valCat r == cat]
+rulesForCat cf cat = [r | r <- cfgRules cf, isParsable r, valCat r == cat]
 
 -- | Like rulesForCat but for normalized value categories.
 -- I.e., `rulesForCat (Cat "Exp")` will return rules for category Exp but also
 -- Exp1, Exp2... in case of coercion
 rulesForNormalizedCat :: CF -> Cat -> [Rule]
 rulesForNormalizedCat cf cat =
-    [r | r <- rulesOfCF cf, isParsable r, normCat (valCat r) == cat]
+    [r | r <- cfgRules cf, isParsable r, normCat (valCat r) == cat]
 
 -- | As rulesForCat, but this version doesn't exclude internal rules.
 rulesForCat' :: CF -> Cat -> [Rule]
-rulesForCat' cf cat = [r | r <- rulesOfCF cf, valCat r == cat]
+rulesForCat' cf cat = [r | r <- cfgRules cf, valCat r == cat]
 
 -- | Get all categories of a grammar. (No Cat w/o production returned; No duplicates)
 allCats :: CFG f -> [Cat]
-allCats = nub . map valCat . rulesOfCF
+allCats = nub . map valCat . cfgRules
 
 -- | Gets all normalized identified Categories
 allCatsIdNorm :: CF -> [String]
@@ -487,7 +453,7 @@
 
 -- | Is the category is used on an rhs?
 isUsedCat :: CFG f -> Cat -> Bool
-isUsedCat cf cat = cat `elem` [c | r <- rulesOfCF cf, Left c <- rhsRule r]
+isUsedCat cf cat = cat `elem` [c | r <- cfgRules cf, Left c <- rhsRule r]
 
 -- | Group all categories with their rules.
 ruleGroups :: CF -> [(Cat,[Rule])]
@@ -501,33 +467,22 @@
 literals :: CFG f -> [Cat]
 literals cf = [TokenCat l | l <- lits] ++ owns
  where
-   (lits,_,_,_) = infoOfCF cf
+   lits = cfgLiterals cf
    owns = map fst (tokenPragmas cf)
 
--- | Get all symbols
-symbols :: CFG f -> [String]
-symbols cf = syms
- where (_,syms,_,_) = infoOfCF cf
-
 -- | Get the keywords of a grammar.
 reservedWords :: CFG f -> [String]
-reservedWords cf = sort keywords
- where (_,_,keywords,_) = infoOfCF cf
+reservedWords = sort . cfgKeywords
 
 -- | Canonical, numbered list of symbols and reserved words. (These do
 -- not end up in the AST.)
 cfTokens :: CFG f -> [(String,Int)]
-cfTokens cf = zip (sort (symbols cf ++ reservedWords cf)) [1..]
+cfTokens cf = zip (sort (cfgSymbols cf ++ reservedWords cf)) [1..]
 -- NOTE: some backends (incl. Haskell) assume that this list is sorted.
 
--- | Categories that is left-recursive transformable.
-reversibleCats :: CFG f -> [Cat]
-reversibleCats cf = cats
-  where (_,_,_,cats) = infoOfCF cf
-
 -- | Comments can be defined by the 'comment' pragma
 comments :: CF -> ([(String,String)],[String])
-comments cf = case commentPragmas (pragmasOfCF cf) of
+comments cf = case commentPragmas (cfgPragmas cf) of
                xs -> ([p | CommentM p <- xs],
                       [s | CommentS s <- xs])
 
@@ -556,7 +511,7 @@
 
 -- * abstract syntax trees: data type definitions
 --
--- The abstract syncax, instanciated by the Data type, is the type signatures
+-- The abstract syntax, instantiated by the Data type, is the type signatures
 -- of all the constructors.
 
 -- | Return the abstract syntax of the grammar.
@@ -567,7 +522,7 @@
 getAbstractSyntax cf = [ ( c, nub (constructors c) ) | c <- allCatsNorm cf ]
   where
     constructors cat = do
-        rule <- rulesOfCF cf
+        rule <- cfgRules cf
         let f = funRule rule
         guard $ not (isDefinedRule f)
         guard $ not (isCoercion f)
@@ -576,16 +531,17 @@
         return (f, cs)
 
 
--- All the function bellow are variation arround the idea of getting the
+-- | All the functions below implement the idea of getting the
 -- abstract syntax of the grammar with some variation but they seem to do a
--- poor job at handling corner cases involving coercions. Use getAbstractSyntax
--- instead if possible.
+-- poor job at handling corner cases involving coercions.
+-- Use 'getAbstractSyntax' instead if possible.
+
 cf2data' :: (Cat -> Bool) -> CF -> [Data]
 cf2data' predicate cf =
-  [(cat, nub (map mkData [r | r <- rulesOfCF cf,
+  [(cat, nub (map mkData [r | r <- cfgRules cf,
                               let f = funRule r,
                               not (isDefinedRule f),
-                              not (isCoercion f), eqCat cat (valCat r)]))
+                              not (isCoercion f), sameCat cat (valCat r)]))
       | cat <- filter predicate (allCats cf)]
  where
   mkData (Rule f _ its) = (f,[normCat c | Left c <- its, c /= InternalCat])
@@ -593,7 +549,6 @@
 cf2data :: CF -> [Data]
 cf2data = cf2data' isDataCat
 
-
 cf2dataLists :: CF -> [Data]
 cf2dataLists = cf2data' isDataOrListCat
 
@@ -665,16 +620,8 @@
 
 -- | Returns the precedence of a category symbol.
 -- E.g.
---
--- >>> precCat (Cat "Abc")
--- 0
---
 -- >>> precCat (CoercCat "Abc" 4)
 -- 4
---
--- But!
--- >>> precCat (ListCat (CoercCat "Abc" 2))
--- 2
 precCat :: Cat -> Integer
 precCat (CoercCat _ i) = i
 precCat (ListCat c) = precCat c
@@ -692,18 +639,18 @@
 
 -- | Does the category have a position stored in AST?
 isPositionCat :: CFG f -> Cat -> Bool
-isPositionCat cf cat =  or [b | TokenReg name b _ <- pragmasOfCF cf, TokenCat name == cat]
+isPositionCat cf cat =  or [b | TokenReg name b _ <- cfgPragmas cf, TokenCat name == cat]
 
 -- | Grammar with permutation profile à la GF. AR 22/9/2004
-type CFP   = CFG FunP -- (Exts,[RuleP])
+type CFP   = CFG FunP
 type FunP  = (Fun,Prof)
-type RuleP = Rul FunP -- (FunP, (Cat, [Either Cat String]))
+type RuleP = Rul FunP
 
 -- | Pair of: the original function name, profile
 type Prof  = (Fun, [([[Int]],[Int])])
 
 cf2cfp :: CF -> CFP
-cf2cfp (CFG (es,rs)) = CFG (es, map cf2cfpRule rs)
+cf2cfp cfg@CFG{..} = cfg { cfgRules = map cf2cfpRule cfgRules }
 
 cf2cfpRule :: Rule -> RuleP
 cf2cfpRule (Rule f c its)  = Rule (f, (f, trivialProf its)) c its
@@ -714,7 +661,7 @@
 trivialProf :: [Either Cat String] -> [([[Int]],[Int])]
 trivialProf its = [([],[i]) | (i,_) <- zip [0..] [c | Left c <- its]]
 
-{-# DEPRECATED rulesOfCFP, allCatsP, allEntryPointsP  "Use the version without P postfix instead" #-}
+{-# DEPRECATED allCatsP, allEntryPointsP  "Use the version without P postfix instead" #-}
 
 funRuleP :: RuleP -> Fun
 funRuleP = fst . funRule
@@ -723,7 +670,7 @@
 ruleGroupsP cf = [(c, rulesForCatP cf c) | c <- allCatsP cf]
 
 rulesForCatP :: CFP -> Cat -> [RuleP]
-rulesForCatP cf cat = [r | r <- rulesOfCFP cf, isParsable r, valCat r == cat]
+rulesForCatP cf cat = [r | r <- cfgRules cf, isParsable r, valCat r == cat]
 
 allCatsP :: CFP -> [Cat]
 allCatsP = allCats
@@ -731,7 +678,7 @@
 
 -- | Categories that are entry points to the parser
 allEntryPoints :: CFG f -> [Cat]
-allEntryPoints cf = case concat [cats | EntryPoints cats <- pragmasOfCF cf] of
+allEntryPoints cf = case concat [cats | EntryPoints cats <- cfgPragmas cf] of
   [] -> allCats cf
   cs -> cs
 
diff --git a/src/BNFC/GetCF.hs b/src/BNFC/GetCF.hs
--- a/src/BNFC/GetCF.hs
+++ b/src/BNFC/GetCF.hs
@@ -14,11 +14,11 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 
-module BNFC.GetCF(parseCF, parseCFP) where
+module BNFC.GetCF where
 
 import qualified AbsBNF as Abs
 import ParBNF
@@ -34,6 +34,8 @@
 import Data.List(nub,partition)
 import Data.Maybe (mapMaybe)
 import ErrM
+import System.Exit (exitFailure)
+import System.IO (hPutStrLn, stderr)
 
 -- $setup
 -- >>> import PrintBNF
@@ -66,7 +68,7 @@
   putStrLn $ unlines msgs3
 
   -- Print the number of rules
-  putStrLn $ show (length (rulesOfCF cf)) +++ "rules accepted\n"
+  putStrLn $ show (length (cfgRules cf)) +++ "rules accepted\n"
 
   -- Print a warning if comment delimiter are bigger than 2 characters
   let c3s = [(b,e) | (b,e) <- fst (comments cf), length b > 2 || length e > 2]
@@ -77,7 +79,7 @@
 
   where
     runErr (Ok a) = return a
-    runErr (Bad msg) = fail msg
+    runErr (Bad msg) = hPutStrLn stderr msg >> exitFailure
 
 {-
     case filter (not . isDefinedRule) $ notUniqueFuns cf of
@@ -116,24 +118,24 @@
                   notIdent s         = null s || not (isAlpha (head s)) || any (not . isIdentRest) s
                   isIdentRest c      = isAlphaNum c || c == '_' || c == '\''
                   reservedWords      = nub [t | r <- rules, Right t <- rhsRule r]
-              in CFG((pragma,(literals,symbols,keywords,[])),rules)
-        revs cf1@(CFG((pragma,(literals,symbols,keywords,_)),rules)) =
-            CFG((pragma,(literals,symbols,keywords,findAllReversibleCats (cfp2cf cf1))),rules)
-    case mapMaybe (checkRule (cfp2cf cf0)) (rulesOfCF cf0) of
+              in CFG pragma literals symbols keywords [] rules
+    case mapMaybe (checkRule (cfp2cf cf0)) (cfgRules cf0) of
       [] -> return ()
       msgs -> fail (unlines msgs)
     return cf0
   where
     (pragma,rules0) = partitionEithers $ concatMap transDef defs
     (defs,inlineDelims) = if cnf then (defs0,id) else removeDelims defs0
+    revs cf1@CFG{..} =
+        cf1 { cfgReversibleCats = findAllReversibleCats (cfp2cf cf1) }
 
 -- | This function goes through each rule of a grammar and replace Cat "X" with
 -- TokenCat "X" when "X" is a token type.
 markTokenCategories :: CFP -> Err CFP
-markTokenCategories (CFG (exts, rules)) = return $ CFG (exts, newRules)
+markTokenCategories cf@CFG{..} = return $ cf { cfgRules = newRules }
   where
-    newRules = [ Rule f (mark c) (map (left mark) rhs) | Rule f c rhs <- rules ]
-    tokenCatNames = [ n | TokenReg n _ _ <- fst exts ] ++ specialCatsP
+    newRules = [ Rule f (mark c) (map (left mark) rhs) | Rule f c rhs <- cfgRules ]
+    tokenCatNames = [ n | TokenReg n _ _ <- cfgPragmas ] ++ specialCatsP
     mark = toTokenCat tokenCatNames
 
 
@@ -159,12 +161,12 @@
     (ds,ys) = partition isDelim xs
     isDelim (Abs.Delimiters{}) = True
     isDelim _ = False
-    
+
     inlineDelim :: Abs.Def -> Either Cat String ->  [Either Cat String]
     inlineDelim (Abs.Delimiters cat open close _ _) (Left c)
       | c == ListCat (transCat cat) = [Right open, Left c, Right close]
     inlineDelim _ x = [x]
-    
+
     inlineDelim' :: Abs.Def -> RuleP -> RuleP
     inlineDelim' d@(Abs.Delimiters cat _ _ _ _) r@(Rule f c rhs)
       | c == ListCat (transCat cat) = r
@@ -176,18 +178,18 @@
     delimToSep (Abs.Delimiters cat _ _ (Abs.SepSepar s) sz) = Abs.Separator  sz cat s
     delimToSep (Abs.Delimiters cat _ _  Abs.SepNone     sz) = Abs.Terminator sz cat ""
     delimToSep x = x
-    
+
 transDef :: Abs.Def -> [Either Pragma RuleP]
 transDef x = case x of
  Abs.Rule label cat items ->
-   [Right $ Rule (transLabel label) (transCat cat) (map transItem items)]
+   [Right $ Rule (transLabel label) (transCat cat) (concatMap transItem items)]
  Abs.Comment str               -> [Left $ CommentS str]
  Abs.Comments str0 str         -> [Left $ CommentM (str0,str)]
  Abs.Token ident reg           -> [Left $ TokenReg (transIdent ident) False reg]
  Abs.PosToken ident reg        -> [Left $ TokenReg (transIdent ident) True reg]
  Abs.Entryp idents             -> [Left $ EntryPoints (map (strToCat .transIdent) idents)]
  Abs.Internal label cat items  ->
-   [Right $ Rule (transLabel label) (transCat cat) (Left InternalCat:map transItem items)]
+   [Right $ Rule (transLabel label) (transCat cat) (Left InternalCat:concatMap transItem items)]
  Abs.Separator size ident str -> map  (Right . cf2cfpRule) $ separatorRules size ident str
  Abs.Terminator size ident str -> map  (Right . cf2cfpRule) $ terminatorRules size ident str
  Abs.Delimiters a b c d e -> map  (Right . cf2cfpRule) $ delimiterRules a b c d e
@@ -275,7 +277,7 @@
 
 ebnfRules :: Abs.Ident -> [Abs.RHS] -> [Rule]
 ebnfRules (Abs.Ident c) rhss =
-  [Rule (mkFun k its) (strToCat c) (map transItem its)
+  [Rule (mkFun k its) (strToCat c) (concatMap transItem its)
      | (k, Abs.RHS its) <- zip [1 :: Int ..] rhss]
  where
    mkFun k i = case i of
@@ -286,10 +288,16 @@
    mkName k s = if all (\c -> isAlphaNum c || elem c ("_'" :: String)) s
                    then s else show k
 
-transItem :: Abs.Item -> Either Cat String
-transItem x = case x of
- Abs.Terminal str   -> Right str
- Abs.NTerminal cat  -> Left (transCat cat)
+-- | Translate a rule item (terminal or non terminal)
+-- It also sanitizes the terminals a bit by skipping empty terminals
+-- or splitting multiwords terminals.
+-- This means that the following rule
+--   Foo. S ::= "foo bar" ""
+-- is equivalent to
+--   Foo. S ::= "foo" "bar"
+transItem :: Abs.Item -> [Either Cat String]
+transItem (Abs.Terminal str) = [Right w | w <- words str]
+transItem (Abs.NTerminal cat) = [Left (transCat cat)]
 
 transCat :: Abs.Cat -> Cat
 transCat x = case x of
@@ -382,8 +390,8 @@
   | badSpecial     = Just $ "Bad special category rule" +++ s
   | badTypeName    = Just $ "Bad type name" +++ unwords (map show badtypes) +++ "in" +++ s
   | badFunName     = Just $ "Bad constructor name" +++ f +++ "in" +++ s
-  | badMissing     = Just $ "No production for" +++ unwords missing ++
-                             ", appearing in rule" +++ s +++ ". Defined categories:" +++ unwords defineds
+  | badMissing     = Just $ "no production for" +++ unwords missing ++
+                             ", appearing in rule\n    " ++ s
   | otherwise      = Nothing
  where
    s  = f ++ "." +++ show cat +++ "::=" +++ unwords (map (either show show) rhs) -- Todo: consider using the show instance of Rule
@@ -401,7 +409,7 @@
    missing     = filter nodef [show c | Left c <- rhs]
    nodef t = t `notElem` defineds
    defineds =
-    show InternalCat : tokenNames cf ++ specialCatsP ++ map (show . valCat) (rulesOfCF cf)
+    show InternalCat : tokenNames cf ++ specialCatsP ++ map (show . valCat) (cfgRules cf)
    badTypeName = not (null badtypes)
    badtypes = filter isBadType $ cat : [c | Left c <- rhs]
    isBadType (ListCat c) = isBadType c
@@ -427,9 +435,9 @@
 -- let Ok tree = expandRules (Abs.Grammar [rules1])
 -- in putStrLn (printTree tree)
 -- :}
--- Foo_abc . Foo ::= "abc" ;
--- FooA . Foo ::= A ;
--- Foo1 . Foo ::= "foo" "bar" ;
+-- Foo_abc . Foo ::= "abc";
+-- FooA . Foo ::= A;
+-- Foo1 . Foo ::= "foo" "bar";
 -- Foo2 . Foo ::= "++"
 --
 -- Note that if there are two `rules` macro with the same category, the
@@ -444,7 +452,7 @@
 -- let Ok tree = expandRules (Abs.Grammar [rules1, rules2])
 -- in putStrLn (printTree tree)
 -- :}
--- Foo1 . Foo ::= "foo" "bar" ;
+-- Foo1 . Foo ::= "foo" "bar";
 -- Foo2 . Foo ::= "foo" "foo"
 --
 -- This is using a State monad to remember the last used index for a category.
diff --git a/src/BNFC/Lexing.hs b/src/BNFC/Lexing.hs
--- a/src/BNFC/Lexing.hs
+++ b/src/BNFC/Lexing.hs
@@ -1,15 +1,18 @@
+{-# LANGUAGE NoImplicitPrelude #-}
+
 module BNFC.Lexing
     ( mkLexer, LexType(..) ) where
 
+import Prelude'
+
 import Control.Arrow ((&&&))
 import Data.List (inits)
 import AbsBNF (Reg(..))
-import PrintBNF
 import BNFC.CF
 
-
-p :: Reg -> IO ()
-p = putStrLn . concat . words . printTree
+-- $setup
+-- >>> import PrintBNF
+-- >>> let p = putStrLn . concat . words . printTree :: Reg -> IO ()
 
 -- Abstract lexer
 
@@ -29,7 +32,7 @@
     [ ( regIdent, LexToken "Ident" ) ]
     ++
     -- Symbols
-    [ (foldl1 RAlt (map RSeqs (symbols cf)), LexSymbols ) ]
+    [ (foldl1 RAlt (map RSeqs (cfgSymbols cf)), LexSymbols ) ]
     ++
     -- Built-ins
     [ ( regInteger, LexToken "Integer")
diff --git a/src/BNFC/MultiView.hs b/src/BNFC/MultiView.hs
--- a/src/BNFC/MultiView.hs
+++ b/src/BNFC/MultiView.hs
@@ -14,24 +14,16 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 
 module BNFC.MultiView where
 
-import System.Directory	( doesFileExist, renameFile )
-
-import qualified BNFC.CF as CF
-import BNFC.Utils
 import ParBNF
 import PrintBNF
-import Data.List(nub,partition)
 import AbsBNF
--- import LexBNF
 import ErrM
-import Data.Char
-import BNFC.TypeChecker
 
 preprocessMCF :: FilePath -> IO ([FilePath],String)
 preprocessMCF f = do
diff --git a/src/BNFC/Options.hs b/src/BNFC/Options.hs
--- a/src/BNFC/Options.hs
+++ b/src/BNFC/Options.hs
@@ -55,6 +55,12 @@
 data HappyMode = Standard | GLR
   deriving (Eq,Show,Bounded,Enum,Ord)
 
+data JavaLexerParser = JLexCup | JFlexCup | Antlr4
+    deriving (Eq,Show,Ord)
+
+data RecordPositions = RecordPositions | NoRecordPositions
+    deriving (Eq,Show,Ord)
+
 -- | This is the option record that is passed to the different backends
 data SharedOptions = Options
   -- Option shared by at least 2 backends
@@ -67,7 +73,7 @@
   , lang :: String
   -- Haskell specific:
   , alexMode :: AlexVersion
-  , jflex :: Bool
+  , javaLexerParser :: JavaLexerParser
   , inDir :: Bool
   , shareStrings :: Bool
   , byteStrings :: Bool
@@ -75,7 +81,7 @@
   , xml :: Int
   , ghcExtensions :: Bool
   -- C++ specific
-  , linenumbers :: Bool       -- ^ Add and set line_number field for syntax classes
+  , linenumbers :: RecordPositions -- ^ Add and set line_number field for syntax classes
   -- C# specific
   , visualStudio :: Bool      -- ^ Generate Visual Studio solution/project files
   , wcf :: Bool               -- ^ Windows Communication Foundation
@@ -102,12 +108,12 @@
   , xml = 0
   , ghcExtensions = False
   , lang = error "lang not set"
-  , linenumbers = False
+  , linenumbers = NoRecordPositions
   , visualStudio = False
   , wcf = False
   , functor = False
   , outDir  = "."
-  , jflex = False
+  , javaLexerParser = JLexCup
   }
 
 -- ~~~ Option definition ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -122,7 +128,7 @@
 targetOptions :: [ OptDescr (SharedOptions -> SharedOptions)]
 targetOptions = 
   [ Option "" ["java"]          (NoArg (\o -> o {target = TargetJava}))
-    "Output Java code for use with JLex and CUP"
+    "Output Java code [default: for use with JLex and CUP]"
   , Option "" ["haskell"]       (NoArg (\o -> o {target = TargetHaskell}))
     "Output Haskell code for use with Alex and Happy (default)"
   , Option "" ["haskell-gadt"]  (NoArg (\o -> o {target = TargetHaskellGadt}))
@@ -149,16 +155,22 @@
 -- they apply to.
 specificOptions :: [(OptDescr (SharedOptions -> SharedOptions), [Target])]
 specificOptions =
-  [ ( Option ['l'] [] (NoArg (\o -> o {linenumbers = True}))
-        "Add and set line_number field for all syntax classes"
-    , [TargetCpp] )
+  [ ( Option ['l'] [] (NoArg (\o -> o {linenumbers = RecordPositions}))
+        "Add and set line_number field for all syntax classes\nJava requires cup 0.11b-2014-06-11 or greater"
+    , [TargetCpp, TargetJava] )
   , ( Option ['p'] []
       (ReqArg (\n o -> o {inPackage = Just n}) "<namespace>")
       "Prepend <namespace> to the package/module name"
     , [TargetCpp, TargetCSharp, TargetHaskell, TargetHaskellGadt, TargetProfile, TargetJava] )
-  , ( Option [] ["jflex"] (NoArg (\o -> o {jflex = True}))
-          "Use JFlex instead of JLex for lexing"
+  , ( Option [] ["jflex"] (NoArg (\o -> o {javaLexerParser = JFlexCup}))
+          "Lex with JFlex, parse with CUP"
     , [TargetJava] )
+    , ( Option [] ["jlex"] (NoArg (\o -> o {javaLexerParser = Antlr4}))
+                  "Lex with Jlex, parse with CUP (default)"
+            , [TargetJava] )
+    , ( Option [] ["antlr4"] (NoArg (\o -> o {javaLexerParser = Antlr4}))
+              "Lex and parse with antlr4"
+        , [TargetJava] )
   , ( Option [] ["vs"] (NoArg (\o -> o {visualStudio = True}))
           "Generate Visual Studio solution/project files"
     , [TargetCSharp] )
@@ -269,28 +281,28 @@
 -- A translating function to maintain backward compatiblicy
 -- with the old option syntay
 translateOldOptions :: [String] -> [String]
-translateOldOptions = concatMap translateOne
-  where translateOne "-java" = return "--java"
-        translateOne "-java1.5"       = return "--java"
-        translateOne "-c"             = return "--c"
-        translateOne "-cpp"           = return "--cpp"
-        translateOne "-cpp_stl"       = return "--cpp"
-        translateOne "-cpp_no_stl"    = return "--cpp-nostl"
-        translateOne "-csharp"        = return "--csharp"
-        translateOne "-ocaml"         = return "--ocaml"
-        translateOne "-fsharp"        = return "fsharp"
-        translateOne "-haskell"       = return "--haskell"
-        translateOne "-prof"          = return "--profile"
-        translateOne "-gadt"          = return "--haskell-gadt"
-        translateOne "-alex1"         = return "--alex1"
-        translateOne "-alex2"         = return "--alex2"
-        translateOne "-alex3"         = return "--alex3"
-        translateOne "-sharestrings"  = return "--sharestring"
-        translateOne "-bytestrings"   = return "--bytestring"
-        translateOne "-glr"           = return "--glr"
-        translateOne "-xml"           = return "--xml"
-        translateOne "-xmlt"          = return "--xmlt"
-        translateOne "-vs"            = return "--vs"
-        translateOne "-wcf"           = return "--wcf"
-        translateOne other            = return other
+translateOldOptions = map translateOne
+  where translateOne "-java"          = "--java"
+        translateOne "-java1.5"       = "--java"
+        translateOne "-c"             = "--c"
+        translateOne "-cpp"           = "--cpp"
+        translateOne "-cpp_stl"       = "--cpp"
+        translateOne "-cpp_no_stl"    = "--cpp-nostl"
+        translateOne "-csharp"        = "--csharp"
+        translateOne "-ocaml"         = "--ocaml"
+        translateOne "-fsharp"        = "fsharp"
+        translateOne "-haskell"       = "--haskell"
+        translateOne "-prof"          = "--profile"
+        translateOne "-gadt"          = "--haskell-gadt"
+        translateOne "-alex1"         = "--alex1"
+        translateOne "-alex2"         = "--alex2"
+        translateOne "-alex3"         = "--alex3"
+        translateOne "-sharestrings"  = "--sharestring"
+        translateOne "-bytestrings"   = "--bytestring"
+        translateOne "-glr"           = "--glr"
+        translateOne "-xml"           = "--xml"
+        translateOne "-xmlt"          = "--xmlt"
+        translateOne "-vs"            = "--vs"
+        translateOne "-wcf"           = "--wcf"
+        translateOne other            = other
 
diff --git a/src/BNFC/PrettyPrint.hs b/src/BNFC/PrettyPrint.hs
--- a/src/BNFC/PrettyPrint.hs
+++ b/src/BNFC/PrettyPrint.hs
@@ -1,3 +1,5 @@
+{-# LANGUAGE NoImplicitPrelude #-}
+
 -- Extends Text.PrettyPrint
 module BNFC.PrettyPrint
   ( module Text.PrettyPrint
@@ -6,6 +8,8 @@
   , vsep
   , (<=>)
   ) where
+
+import Prelude'
 
 import Text.PrettyPrint
 
diff --git a/src/BNFC/ToCNFCore.hs b/src/BNFC/ToCNFCore.hs
--- a/src/BNFC/ToCNFCore.hs
+++ b/src/BNFC/ToCNFCore.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE TypeSynonymInstances, FlexibleInstances #-}
+{-# LANGUAGE TypeSynonymInstances, FlexibleInstances, CPP #-}
 {-
     Copyright (C) 2012  Authors:
     Jean-Philippe Bernardy.
@@ -15,7 +15,7 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 {-# LANGUAGE OverloadedStrings #-}
@@ -34,7 +34,9 @@
 
 import BNFC.CF hiding (App,Exp)
 import Control.Monad.RWS
+#if __GLASGOW_HASKELL__ < 710
 import Control.Applicative hiding (Const)
+#endif
 import qualified Data.Map as M
 import Data.List (nub,sortBy,sort)
 import Data.Function (on)
@@ -45,12 +47,12 @@
 (f *** g) (a,b) = (f a, g b)
 second g = id *** g
 
-onRules f (CFG (exts,rules)) = CFG (exts,f rules)
+onRules f cfg@CFG{..} = cfg { cfgRules = f cfgRules }
 
 toCNF cf0 = (cf1,cf2,units,descriptions,neighbors)
-  where cf01@(CFG (exts01,_)) = funToExp . onRules delInternal $ cf0
-        (rules',descriptions) = toBin (rulesOfCF cf01)
-        cf1 = CFG (exts01,rules')
+  where cf01 = funToExp . onRules delInternal $ cf0
+        (rules',descriptions) = toBin (cfgRules cf01)
+        cf1 = cf01 { cfgRules = rules' }
         cf2 = delNull cf1
         units = unitSet cf2
         neighbors = neighborSet cf2
@@ -133,7 +135,7 @@
 fixpointOnGrammar name f cf = case fixn 100 step M.empty of
   Left x -> error $ "Could not find fixpoint of " ++ name ++". Last iteration:\n" ++ show x
   Right x -> x
-  where step curSet = M.unionsWith (∪) (map (f curSet) (rulesOfCF cf))
+  where step curSet = M.unionsWith (∪) (map (f curSet) (cfgRules cf))
 
 fixn :: Eq a => Int -> (a -> a) -> a -> Either a a
 fixn 0 _ x = Left x
@@ -206,7 +208,7 @@
 isEntryPoint cf el = either (`elem` allEntryPoints cf) (const False) el
 
 occurs :: (RHSEl -> Rul f -> Bool) -> RHSEl -> CFG f -> Bool
-occurs where_ el cf = any (where_ el) (rulesOfCF cf)
+occurs where_ el cf = any (where_ el) (cfgRules cf)
 
 splitLROn :: (a -> RHSEl) -> CFG f -> [a] -> Pair [a]
 splitLROn f cf xs = filt <*> pure xs
@@ -239,7 +241,7 @@
 lkCat (Left c) s = Left c:lookupMulti (show c) s
 
 -- neighbors A B = ∃ A' B'. P ::= A' B' ∧  A ∈ rightOf A'  ∧  B ∈ leftOf B
-neighborSet cf = map (second (nub . sort)) $ group' [(x',lkCat y leftSet) | Rule _ _ [x,y] <- rulesOfCF cf, x' <- lkCat x rightSet]
+neighborSet cf = map (second (nub . sort)) $ group' [(x',lkCat y leftSet) | Rule _ _ [x,y] <- cfgRules cf, x' <- lkCat x rightSet]
   where leftSet  = fixpointOnGrammar "left set"  (leftRight head) cf
         rightSet = fixpointOnGrammar "right set" (leftRight last) cf
 
diff --git a/src/BNFC/TypeChecker.hs b/src/BNFC/TypeChecker.hs
--- a/src/BNFC/TypeChecker.hs
+++ b/src/BNFC/TypeChecker.hs
@@ -2,8 +2,10 @@
 module BNFC.TypeChecker where
 
 import Control.Monad
-import Data.List
+
 import Data.Char
+import Data.Function (on)
+import Data.List
 
 import BNFC.CF
 import ErrM
@@ -22,24 +24,27 @@
 instance Show Type where
     show (FunT ts t) = unwords $ map show ts ++ ["->", show t]
 
-data Context = Ctx  { ctxLabels :: [(String, Type)]
-                    , ctxTokens :: [String]
-                    }
+data Context = Ctx
+  { ctxLabels :: [(String, Type)]
+  , ctxTokens :: [String]
+  }
 
 catchErr :: Err a -> (String -> Err a) -> Err a
 catchErr (Bad s) f = f s
 catchErr (Ok x) _  = Ok x
 
 buildContext :: CF -> Context
-buildContext cf@(CFG(_,rules)) =
-    Ctx
-    [ (f, mkType cat args) | Rule f cat args <- rules
-                           , not (isCoercion f)
-                           , not (isNilCons f)
-    ]
-    ("Ident" : tokenNames cf)
+buildContext cf@CFG{..} = Ctx
+  { ctxLabels =
+      [ (f, mkType cat args)
+        | Rule f cat args <- cfgRules
+        , not (isCoercion f)
+        , not (isNilCons f)
+      ]
+  , ctxTokens =
+      ("Ident" : tokenNames cf)
+  }
   where
-
     mkType cat args = FunT [ mkBase t | Left t <- args, t /= InternalCat ]
                            (mkBase cat)
     mkBase t
@@ -63,7 +68,7 @@
 checkDefinitions :: CF -> Err ()
 checkDefinitions cf =
     do  checkContext ctx
-        sequence_ [checkDefinition ctx f xs e | FunDef f xs e <- pragmasOfCF cf]
+        sequence_ [checkDefinition ctx f xs e | FunDef f xs e <- cfgPragmas cf]
     where
         ctx = buildContext cf
 
@@ -76,12 +81,9 @@
         -- keys.
         groupSnd :: Ord a => [(a,b)] -> [(a,[b])]
         groupSnd =
-            map ((fst . head) /\ map snd)
-            . groupBy ((==) **.* fst)
-            . sortBy (compare **.* fst)
-
-        (f /\ g) x     = (f x, g x)
-        (f **.* g) x y = f (g x) (g y)
+            map (\ ps -> (fst (head ps), map snd ps))
+            . groupBy ((==) `on` fst)
+            . sortBy (compare `on` fst)
 
         checkEntry (f,ts) =
             case nub ts of
@@ -142,4 +144,3 @@
 checkExp _ _ e@(LitChar _) (BaseT "Char")       = return e
 checkExp _ _ e@(LitString _) (BaseT "String")   = return e
 checkExp _ _ e t = fail $ show e ++ " does not have type " ++ show t ++ "."
-
diff --git a/src/BNFC/Utils.hs b/src/BNFC/Utils.hs
--- a/src/BNFC/Utils.hs
+++ b/src/BNFC/Utils.hs
@@ -14,36 +14,51 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 module BNFC.Utils
-    ( (+++), (++++)
+    ( (+++), (++++), (+-+), (+.+)
     , mkName, mkNames, NameStyle(..)
     , lowerCase, upperCase, mixedCase, camelCase, snakeCase
     , replace, prParenth
     , writeFileRep
+    , cstring, cchar
     ) where
 
 import Control.Arrow ((&&&))
 import Control.DeepSeq (rnf)
+
 import Data.Char
 import Data.List (intercalate)
+
 import System.IO (IOMode(ReadMode),hClose,hGetContents,openFile)
 import System.IO.Error (tryIOError)
-import System.Directory (createDirectory, doesDirectoryExist, renameFile,
-                         removeFile)
+-- import System.Directory (renameFile, removeFile)
+
 import BNFC.PrettyPrint
 
-infixr 5 +++
-infixr 5 ++++
+infixr 5 +++, ++++, +-+, +.+
 
 -- printing operations
 
-(+++), (++++) :: String -> String -> String
+-- | Concatenate strings by a space.
+(+++) :: String -> String -> String
 a +++ b   = a ++ " "    ++ b
+
+-- | Concatenate strings by a newline.
+(++++) :: String -> String -> String
 a ++++ b  = a ++ "\n"   ++ b
 
+-- | Concatenate strings by an underscore.
+(+-+) :: String -> String -> String
+a +-+ b   = a ++ "_"    ++ b
+
+-- | Concatenate strings by a dot.
+(+.+) :: String -> String -> String
+a +.+ b   = a ++ "."    ++ b
+
+-- | Parenthesize a string unless it is empty.
 prParenth :: String -> String
 prParenth s = if s == "" then "" else "(" ++ s ++ ")"
 
@@ -62,48 +77,52 @@
 -- If an old version of the file exist and the new version is the same,
 -- keep the old file and don't create a .bak file.
 -- / New version by TH, 2010-09-23
+
 writeFileRep :: FilePath -> String -> IO ()
 writeFileRep path s =
     either newFile updateFile =<< tryIOError (readFile' path)
   where
-    newFile _ =
-        do putStrLn $ "writing new file "++path
-           writeFile path s
-    updateFile old =
-        do let tmp=path++".tmp"
-           writeFile tmp s
-           new <- readFile' tmp
-           if new==old  -- test is O(1) space, O(n) time
-              then do putStrLn $ "no change to file "++path
-                      removeFile tmp
-              else do let bak=path++".bak"
-                      putStrLn $ "writing file "++path
-                                   ++" (saving old file as "++bak++")"
-                      renameFile path bak
-                      renameFile tmp path
+    -- Case: file does not exist yet.
+    newFile _ = do
+      putStrLn $ "writing new file " ++ path
+      writeFile path s
 
-    -- force reading of contents of files to achieve compatibility with
-    -- Windows IO handling as combining lazy IO with `readFile` and
-    -- 2x `renameFile` on the open `path` file complains with
+    -- Case: file exists with content @old@.
+    updateFile old = do
+      -- Write new content.
+      writeFile path s
+      if s == old  -- test is O(1) space, O(n) time
+         then do
+           putStrLn $ "refreshing unchanged file " ++ path
+         else do
+           let bak = path ++ ".bak"
+           putStrLn $ "writing file " ++ path ++ " (saving old file as " ++ bak ++ ")"
+           writeFile bak old
+
+    -- Force reading of contents of files to achieve compatibility with
+    -- Windows IO handling, as combining lazy IO with `readFile` and
+    -- 2x `renameFile` on the open `path` file complains with:
+    --
     -- "bnfc.exe: Makefile: MoveFileEx "Makefile" "Makefile.bak": permission
     -- denied (The process cannot access the file because it is being used
     -- by another process.)"
     readFile' :: FilePath -> IO String
-    readFile' path' =
-        do inFile <- openFile path' ReadMode
-           contents <- hGetContents inFile
-           rnf contents `seq` hClose inFile
-           return contents
+    readFile' path' = do
+      inFile   <- openFile path' ReadMode
+      contents <- hGetContents inFile
+      rnf contents `seq` hClose inFile
+      return contents
 
 -- *** Naming ***
 -- Because naming is hard (http://blog.codinghorror.com/i-shall-call-it-somethingmanager/)
 
 -- | Different case style
-data NameStyle = LowerCase  -- ^ e.g. @lowercase@
-               | UpperCase  -- ^ e.g. @UPPERCASE@
-               | SnakeCase  -- ^ e.g. @snake_case@
-               | CamelCase  -- ^ e.g. @CamelCase@
-               | MixedCase  -- ^ e.g. @mixedCase@
+data NameStyle
+  = LowerCase  -- ^ e.g. @lowercase@
+  | UpperCase  -- ^ e.g. @UPPERCASE@
+  | SnakeCase  -- ^ e.g. @snake_case@
+  | CamelCase  -- ^ e.g. @CamelCase@
+  | MixedCase  -- ^ e.g. @mixedCase@
   deriving (Show, Eq)
 
 -- | Generate a name in the given case style taking into account the reserved
@@ -111,23 +130,33 @@
 -- to be used in code rendering (type Doc), we return a String here to allow
 -- further manipulation of the name (like disambiguation) which is not possible
 -- in the Doc type.
+--
 -- Examples:
+--
 -- >>> mkName [] LowerCase "FooBAR"
 -- "foobar"
+--
 -- >>> mkName [] UpperCase "FooBAR"
 -- "FOOBAR"
+--
 -- >>> mkName [] SnakeCase "FooBAR"
 -- "foo_bar"
+--
 -- >>> mkName [] CamelCase "FooBAR"
 -- "FooBAR"
+--
 -- >>> mkName [] CamelCase "Foo_bar"
 -- "FooBar"
+--
 -- >>> mkName [] MixedCase "FooBAR"
 -- "fooBAR"
+--
 -- >>> mkName ["foobar"] LowerCase "FooBAR"
 -- "foobar_"
+--
 -- >>> mkName ["foobar", "foobar_"] LowerCase "FooBAR"
 -- "foobar__"
+
 mkName :: [String] -> NameStyle -> String -> String
 mkName reserved style s = notReserved name'
   where
@@ -148,15 +177,19 @@
 
 -- | Same as above but accept a list as argument and make sure that the
 -- names generated are uniques.
+--
 -- >>> mkNames ["c"] LowerCase ["A", "b_", "a_", "c"]
 -- ["a1","b","a2","c_"]
+
 mkNames :: [String] -> NameStyle -> [String] -> [String]
 mkNames reserved style = disambiguateNames . map (mkName reserved style)
 
 -- | This one takes a list of names and makes sure each is unique, appending
--- numerical suffix if needed
+-- numerical suffix if needed.
+--
 -- >>> disambiguateNames ["a", "b", "a", "c"]
 -- ["a1","b","a2","c"]
+
 disambiguateNames :: [String] -> [String]
 disambiguateNames = disamb []
   where
@@ -166,7 +199,7 @@
       | otherwise = n : disamb (n:ns1) ns2
     disamb _ [] = []
 
--- | Heuristic to "parse" an identifier into separate componennts
+-- | Heuristic to "parse" an identifier into separate components.
 --
 -- >>> parseIdent "abc"
 -- ["abc"]
@@ -183,57 +216,109 @@
 -- >>> parseIdent "why-so-serious"
 -- ["why","so","serious"]
 --
--- Some corner cases
+-- Some corner cases:
+--
 -- >>> parseIdent "LBNFParser"
 -- ["LBNF","Parser"]
 --
+-- >>> parseIdent "aLBNFParser"
+-- ["a","LBNF","Parser"]
+--
 -- >>> parseIdent "ILoveNY"
 -- ["I","Love","NY"]
+
 parseIdent :: String -> [String]
 parseIdent = p [] . map (classify &&& id)
   where
+    classify :: Char -> CharClass
     classify c
         | isUpper c = U
         | isLower c = L
         | otherwise = O
-    p [] [] = []
-    p acc [] = reverse acc: p [] []
-    p [] ((L,c):cs) = p [c] cs
-    p [] ((U,c):cs) = p [c] cs
-    p [] ((O,_):cs) = p [] cs
-    p acc ((L,c1):cs@((L,_):_)) = p (c1:acc) cs
-    p acc ((U,c1):cs@((L,_):_)) = reverse acc:p [c1] cs
-    p acc ((U,c1):cs@((U,_):_)) = p (c1:acc) cs
-    p acc ((L,c1):cs@((U,_):_)) = reverse (c1:acc) : p [] cs
-    p acc ((U,c1):(O,_):cs) = reverse (c1:acc) : p [] cs
-    p acc ((L,c1):(O,_):cs) = reverse (c1:acc) : p [] cs
-    p acc ((O,_):cs) = reverse acc : p [] cs
-    p acc [(_,c)] = p (c:acc) []
 
+    p :: String -> [(CharClass,Char)] -> [String]
+    -- Done:
+    p acc []                       = emit acc []
+
+    -- Continue if consecutive characters have same case.
+    p acc ((L,c) : cs@((L,_) : _)) = p (c:acc) cs
+    p acc ((U,c) : cs@((U,_) : _)) = p (c:acc) cs
+
+    -- Break if consecutive characters have different case.
+    p acc ((U,c) : cs@((L,_) : _)) = emit acc     $ p [c] cs
+    p acc ((L,c) : cs@((U,_) : _)) = emit (c:acc) $ p [] cs
+
+    -- Discard "other" characters, and break to next component.
+    p acc ((U,c) :     (O,_) : cs) = emit (c:acc) $ p [] cs
+    p acc ((L,c) :     (O,_) : cs) = emit (c:acc) $ p [] cs
+    p acc ((O,_) : cs)             = emit acc     $ p [] cs
+
+    p acc [(_,c)]                  = p (c:acc) []
+
+    emit :: String -> [String] -> [String]
+    emit []  rest = rest
+    emit acc rest = reverse acc : rest
+
 data CharClass = U | L | O
 
--- | Ident to lower case
+-- | Ident to lower case.
 -- >>> lowerCase "MyIdent"
 -- myident
+
 lowerCase :: String -> Doc
 lowerCase = text . mkName [] LowerCase
--- | Ident to upper case
+
+-- | Ident to upper case.
 -- >>> upperCase "MyIdent"
 -- MYIDENT
+
 upperCase :: String -> Doc
 upperCase = text . mkName [] UpperCase
--- | Ident to camel case
+
+-- | Ident to camel case.
 -- >>> camelCase "my_ident"
 -- MyIdent
+
 camelCase :: String -> Doc
 camelCase = text . mkName [] CamelCase
--- | To mixed case
+
+-- | To mixed case.
 -- >>> mixedCase "my_ident"
 -- myIdent
+
 mixedCase :: String -> Doc
 mixedCase = text . mkName [] MixedCase
--- | To snake case
+
+-- | To snake case.
 -- >>> snakeCase "MyIdent"
 -- my_ident
+
 snakeCase :: String -> Doc
 snakeCase = text . mkName [] SnakeCase
+
+-- ESCAPING
+
+-- | a function that renders a c-like string with escaped characters.
+-- Note that although it's called cstring, this can be used with most (all)
+-- backend as they seem to mostly share escaping conventions.
+-- The c in the name is barely an homage for C being the oldest language in
+-- the lot.
+--
+-- >>> cstring "foobar"
+-- "foobar"
+--
+-- >>> cstring "foobar\""
+-- "foobar\""
+cstring :: String -> Doc
+cstring = text . show
+
+
+-- | A function that renders a c-like character.
+--
+-- >>> cchar 'x'
+-- 'x'
+--
+-- >>> cchar '\''
+-- '\''
+cchar :: Char -> Doc
+cchar = text . show
diff --git a/src/BNFC/WarningM.hs b/src/BNFC/WarningM.hs
--- a/src/BNFC/WarningM.hs
+++ b/src/BNFC/WarningM.hs
@@ -19,7 +19,7 @@
   return v
 
 hasWarnings :: WithWarnings a -> Bool
-hasWarnings c = let (v,warnings) = run c in not (null warnings)
+hasWarnings c = let (_,warnings) = run c in not (null warnings)
 
 -- Output a warning
 warn :: String -> WithWarnings ()
diff --git a/src/Data/Pair.hs b/src/Data/Pair.hs
--- a/src/Data/Pair.hs
+++ b/src/Data/Pair.hs
@@ -1,6 +1,9 @@
+{-# LANGUAGE CPP #-}
 module Data.Pair where
 
+#if __GLASGOW_HASKELL__ < 710
 import Control.Applicative
+#endif
 
 infixl 2  :/:
 
diff --git a/src/ErrM.hs b/src/ErrM.hs
--- a/src/ErrM.hs
+++ b/src/ErrM.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE CPP #-}
 -- BNF Converter: Error Monad
 -- Copyright (C) 2004  Author:  Aarne Ranta
 
@@ -7,7 +8,11 @@
 -- the Error monad: like Maybe type with error msgs
 
 import Control.Monad (MonadPlus(..), liftM)
+#if __GLASGOW_HASKELL__ < 710
 import Control.Applicative (Applicative(..), Alternative(..))
+#else
+import Control.Applicative (Alternative(..))
+#endif
 
 data Err a = Ok a | Bad String
   deriving (Read, Show, Eq, Ord)
@@ -22,7 +27,6 @@
   pure = Ok
   (Bad s) <*> _ = Bad s
   (Ok f) <*> o  = liftM f o
-
 
 instance Functor Err where
   fmap = liftM
diff --git a/src/LexBNF.hs b/src/LexBNF.hs
new file mode 100644
--- /dev/null
+++ b/src/LexBNF.hs
@@ -0,0 +1,410 @@
+{-# OPTIONS_GHC -fno-warn-unused-binds -fno-warn-missing-signatures #-}
+{-# LANGUAGE CPP #-}
+{-# LINE 3 "LexBNF.x" #-}
+
+{-# OPTIONS -fno-warn-incomplete-patterns #-}
+{-# OPTIONS_GHC -w #-}
+module LexBNF where
+
+
+
+import qualified Data.Bits
+import Data.Word (Word8)
+import Data.Char (ord)
+
+#if __GLASGOW_HASKELL__ >= 603
+#include "ghcconfig.h"
+#elif defined(__GLASGOW_HASKELL__)
+#include "config.h"
+#endif
+#if __GLASGOW_HASKELL__ >= 503
+import Data.Array
+import Data.Array.Base (unsafeAt)
+#else
+import Array
+#endif
+alex_tab_size :: Int
+alex_tab_size = 8
+alex_base :: Array Int Int
+alex_base = listArray (0,40) [-8,73,-55,-32,201,412,45,540,796,266,0,781,1037,973,1229,1425,1519,1165,0,1445,-37,71,90,1701,1702,1897,1833,0,2079,0,120,-36,-35,0,-33,2296,0,0,114,1511,124]
+
+alex_table :: Array Int Int
+alex_table = listArray (0,2551) [0,30,30,30,30,30,33,37,22,28,5,40,40,40,40,40,40,40,40,40,40,0,0,0,30,2,23,0,0,0,0,14,33,33,33,33,33,31,33,0,38,38,38,38,38,38,38,38,38,38,34,33,0,33,0,33,0,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,33,3,33,0,33,0,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,32,33,33,1,39,39,39,39,39,39,39,39,39,39,30,30,30,30,30,0,0,0,3,40,40,40,40,40,40,40,40,40,40,0,0,0,0,30,0,0,3,0,0,0,0,21,3,38,38,38,38,38,38,38,38,38,38,40,40,40,40,40,40,40,40,40,40,0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,0,29,0,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8,9,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,25,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8,9,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,6,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,0,12,13,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,23,0,0,0,0,23,39,39,39,39,39,39,39,39,39,39,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,0,0,0,0,0,23,26,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,23,23,23,23,23,23,23,23,23,23,0,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,36,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,16,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,0,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,0,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,0,35,35,35,35,35,35,35,35,0,15,17,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,25,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,26,4,18,18,18,18,18,18,18,18,18,18,18,18,18,18,19,7,10,10,10,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,35,0,0,0,0,0,0,0,0,35,35,35,35,35,35,35,35,35,35,0,0,0,0,0,0,0,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,0,0,0,0,35,0,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
+
+alex_check :: Array Int Int
+alex_check = listArray (0,2551) [-1,9,10,11,12,13,61,39,45,45,45,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,32,58,34,-1,-1,-1,-1,39,40,41,42,43,44,45,46,-1,48,49,50,51,52,53,54,55,56,57,58,59,-1,61,-1,63,-1,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,39,93,-1,95,-1,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,45,48,49,50,51,52,53,54,55,56,57,9,10,11,12,13,-1,-1,-1,92,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,32,-1,-1,110,-1,-1,-1,-1,46,116,48,49,50,51,52,53,54,55,56,57,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,195,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,125,-1,-1,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,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,45,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,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,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,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,0,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,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,0,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,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,0,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,-1,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,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,-1,-1,194,195,0,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,34,-1,-1,-1,-1,39,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,92,101,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,110,-1,-1,-1,-1,-1,116,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,0,1,2,3,4,5,6,7,8,9,-1,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,-1,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,-1,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,-1,184,185,186,187,188,189,190,191,-1,194,195,0,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,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,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,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,39,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,-1,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,-1,-1,-1,-1,95,-1,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,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,195,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]
+
+alex_deflt :: Array Int Int
+alex_deflt = listArray (0,40) [-1,5,-1,-1,-1,5,-1,-1,5,5,18,18,3,3,-1,23,-1,23,27,27,-1,-1,-1,-1,-1,28,28,28,28,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]
+
+alex_accept = listArray (0::Int,40) [AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccSkip,AlexAccSkip,AlexAccSkip,AlexAcc (alex_action_3),AlexAcc (alex_action_3),AlexAcc (alex_action_3),AlexAcc (alex_action_3),AlexAcc (alex_action_4),AlexAcc (alex_action_5),AlexAcc (alex_action_6),AlexAcc (alex_action_7),AlexAcc (alex_action_8),AlexAcc (alex_action_8)]
+{-# LINE 39 "LexBNF.x" #-}
+
+
+tok :: (Posn -> String -> Token) -> (Posn -> String -> Token)
+tok f p s = f p s
+
+share :: String -> String
+share = id
+
+data Tok =
+   TS !String !Int    -- reserved words and symbols
+ | TL !String         -- string literals
+ | TI !String         -- integer literals
+ | TV !String         -- identifiers
+ | TD !String         -- double precision float literals
+ | TC !String         -- character literals
+
+ deriving (Eq,Show,Ord)
+
+data Token =
+   PT  Posn Tok
+ | Err Posn
+  deriving (Eq,Show,Ord)
+
+printPosn :: Posn -> String
+printPosn (Pn _ l c) = "line " ++ show l ++ ", column " ++ show c
+
+tokenPos :: [Token] -> String
+tokenPos (t:_) = printPosn (tokenPosn t)
+tokenPos [] = "end of file"
+
+tokenPosn :: Token -> Posn
+tokenPosn (PT p _) = p
+tokenPosn (Err p) = p
+
+tokenLineCol :: Token -> (Int, Int)
+tokenLineCol = posLineCol . tokenPosn
+
+posLineCol :: Posn -> (Int, Int)
+posLineCol (Pn _ l c) = (l,c)
+
+mkPosToken :: Token -> ((Int, Int), String)
+mkPosToken t@(PT p _) = (posLineCol p, prToken t)
+
+prToken :: Token -> String
+prToken t = case t of
+  PT _ (TS s _) -> s
+  PT _ (TL s)   -> show s
+  PT _ (TI s)   -> s
+  PT _ (TV s)   -> s
+  PT _ (TD s)   -> s
+  PT _ (TC s)   -> s
+  Err _         -> "#error"
+
+
+data BTree = N | B String Tok BTree BTree deriving (Show)
+
+eitherResIdent :: (String -> Tok) -> String -> Tok
+eitherResIdent tv s = treeFind resWords
+  where
+  treeFind N = tv s
+  treeFind (B a t left right) | s < a  = treeFind left
+                              | s > a  = treeFind right
+                              | s == a = t
+
+resWords :: BTree
+resWords = b "digit" 21 (b "=" 11 (b "-" 6 (b "*" 3 (b ")" 2 (b "(" 1 N N) N) (b "," 5 (b "+" 4 N N) N)) (b "::=" 9 (b ":" 8 (b "." 7 N N) N) (b ";" 10 N N))) (b "char" 16 (b "]" 14 (b "[" 13 (b "?" 12 N N) N) (b "_" 15 N N)) (b "define" 19 (b "comment" 18 (b "coercions" 17 N N) N) (b "delimiters" 20 N N)))) (b "separator" 31 (b "letter" 26 (b "internal" 24 (b "eps" 23 (b "entrypoints" 22 N N) N) (b "layout" 25 N N)) (b "position" 29 (b "nonempty" 28 (b "lower" 27 N N) N) (b "rules" 30 N N))) (b "upper" 36 (b "token" 34 (b "terminator" 33 (b "stop" 32 N N) N) (b "toplevel" 35 N N)) (b "|" 39 (b "{" 38 (b "views" 37 N N) N) (b "}" 40 N N))))
+   where b s n = let bs = id s
+                  in B bs (TS bs n)
+
+unescapeInitTail :: String -> String
+unescapeInitTail = id . unesc . tail . id where
+  unesc s = case s of
+    '\\':c:cs | elem c ['\"', '\\', '\''] -> c : unesc cs
+    '\\':'n':cs  -> '\n' : unesc cs
+    '\\':'t':cs  -> '\t' : unesc cs
+    '"':[]    -> []
+    c:cs      -> c : unesc cs
+    _         -> []
+
+-------------------------------------------------------------------
+-- Alex wrapper code.
+-- A modified "posn" wrapper.
+-------------------------------------------------------------------
+
+data Posn = Pn !Int !Int !Int
+      deriving (Eq, Show,Ord)
+
+alexStartPos :: Posn
+alexStartPos = Pn 0 1 1
+
+alexMove :: Posn -> Char -> Posn
+alexMove (Pn a l c) '\t' = Pn (a+1)  l     (((c+7) `div` 8)*8+1)
+alexMove (Pn a l c) '\n' = Pn (a+1) (l+1)   1
+alexMove (Pn a l c) _    = Pn (a+1)  l     (c+1)
+
+type Byte = Word8
+
+type AlexInput = (Posn,     -- current position,
+                  Char,     -- previous char
+                  [Byte],   -- pending bytes on the current char
+                  String)   -- current input string
+
+tokens :: String -> [Token]
+tokens str = go (alexStartPos, '\n', [], str)
+    where
+      go :: AlexInput -> [Token]
+      go inp@(pos, _, _, str) =
+               case alexScan inp 0 of
+                AlexEOF                   -> []
+                AlexError (pos, _, _, _)  -> [Err pos]
+                AlexSkip  inp' len        -> go inp'
+                AlexToken inp' len act    -> act pos (take len str) : (go inp')
+
+alexGetByte :: AlexInput -> Maybe (Byte,AlexInput)
+alexGetByte (p, c, (b:bs), s) = Just (b, (p, c, bs, s))
+alexGetByte (p, _, [], s) =
+  case  s of
+    []  -> Nothing
+    (c:s) ->
+             let p'     = alexMove p c
+                 (b:bs) = utf8Encode c
+              in p' `seq` Just (b, (p', c, bs, s))
+
+alexInputPrevChar :: AlexInput -> Char
+alexInputPrevChar (p, c, bs, s) = c
+
+-- | Encode a Haskell String to a list of Word8 values, in UTF8 format.
+utf8Encode :: Char -> [Word8]
+utf8Encode = map fromIntegral . go . ord
+ where
+  go oc
+   | oc <= 0x7f       = [oc]
+
+   | oc <= 0x7ff      = [ 0xc0 + (oc `Data.Bits.shiftR` 6)
+                        , 0x80 + oc Data.Bits..&. 0x3f
+                        ]
+
+   | oc <= 0xffff     = [ 0xe0 + (oc `Data.Bits.shiftR` 12)
+                        , 0x80 + ((oc `Data.Bits.shiftR` 6) Data.Bits..&. 0x3f)
+                        , 0x80 + oc Data.Bits..&. 0x3f
+                        ]
+   | otherwise        = [ 0xf0 + (oc `Data.Bits.shiftR` 18)
+                        , 0x80 + ((oc `Data.Bits.shiftR` 12) Data.Bits..&. 0x3f)
+                        , 0x80 + ((oc `Data.Bits.shiftR` 6) Data.Bits..&. 0x3f)
+                        , 0x80 + oc Data.Bits..&. 0x3f
+                        ]
+
+alex_action_3 =  tok (\p s -> PT p (eitherResIdent (TV . share) s)) 
+alex_action_4 =  tok (\p s -> PT p (eitherResIdent (TV . share) s)) 
+alex_action_5 =  tok (\p s -> PT p (TL $ share $ unescapeInitTail s)) 
+alex_action_6 =  tok (\p s -> PT p (TC $ share s))  
+alex_action_7 =  tok (\p s -> PT p (TI $ share s))    
+alex_action_8 =  tok (\p s -> PT p (TD $ share s)) 
+{-# LINE 1 "templates/GenericTemplate.hs" #-}
+{-# LINE 1 "templates/GenericTemplate.hs" #-}
+{-# LINE 1 "<built-in>" #-}
+{-# LINE 1 "<command-line>" #-}
+
+
+
+
+
+
+
+# 1 "/usr/include/stdc-predef.h" 1 3 4
+
+# 17 "/usr/include/stdc-predef.h" 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{-# LINE 7 "<command-line>" #-}
+{-# LINE 1 "templates/GenericTemplate.hs" #-}
+-- -----------------------------------------------------------------------------
+-- ALEX TEMPLATE
+--
+-- This code is in the PUBLIC DOMAIN; you may copy it freely and use
+-- it for any purpose whatsoever.
+
+-- -----------------------------------------------------------------------------
+-- INTERNALS and main scanner engine
+
+{-# LINE 21 "templates/GenericTemplate.hs" #-}
+
+{-# LINE 51 "templates/GenericTemplate.hs" #-}
+
+{-# LINE 72 "templates/GenericTemplate.hs" #-}
+alexIndexInt16OffAddr arr off = arr ! off
+
+
+{-# LINE 93 "templates/GenericTemplate.hs" #-}
+alexIndexInt32OffAddr arr off = arr ! off
+
+
+{-# LINE 105 "templates/GenericTemplate.hs" #-}
+quickIndex arr i = arr ! i
+
+
+-- -----------------------------------------------------------------------------
+-- Main lexing routines
+
+data AlexReturn a
+  = AlexEOF
+  | AlexError  !AlexInput
+  | AlexSkip   !AlexInput !Int
+  | AlexToken  !AlexInput !Int a
+
+-- alexScan :: AlexInput -> StartCode -> AlexReturn a
+alexScan input (sc)
+  = alexScanUser undefined input (sc)
+
+alexScanUser user input (sc)
+  = case alex_scan_tkn user input (0) input sc AlexNone of
+        (AlexNone, input') ->
+                case alexGetByte input of
+                        Nothing -> 
+
+
+
+                                   AlexEOF
+                        Just _ ->
+
+
+
+                                   AlexError input'
+
+        (AlexLastSkip input'' len, _) ->
+
+
+
+                AlexSkip input'' len
+
+        (AlexLastAcc k input''' len, _) ->
+
+
+
+                AlexToken input''' len k
+
+
+-- Push the input through the DFA, remembering the most recent accepting
+-- state it encountered.
+
+alex_scan_tkn user orig_input len input s last_acc =
+  input `seq` -- strict in the input
+  let 
+        new_acc = (check_accs (alex_accept `quickIndex` (s)))
+  in
+  new_acc `seq`
+  case alexGetByte input of
+     Nothing -> (new_acc, input)
+     Just (c, new_input) -> 
+
+
+
+      case fromIntegral c of { (ord_c) ->
+        let
+                base   = alexIndexInt32OffAddr alex_base s
+                offset = (base + ord_c)
+                check  = alexIndexInt16OffAddr alex_check offset
+                
+                new_s = if (offset >= (0)) && (check == ord_c)
+                          then alexIndexInt16OffAddr alex_table offset
+                          else alexIndexInt16OffAddr alex_deflt s
+        in
+        case new_s of
+            (-1) -> (new_acc, input)
+                -- on an error, we want to keep the input *before* the
+                -- character that failed, not after.
+            _ -> alex_scan_tkn user orig_input (if c < 0x80 || c >= 0xC0 then (len + (1)) else len)
+                                                -- note that the length is increased ONLY if this is the 1st byte in a char encoding)
+                        new_input new_s new_acc
+      }
+  where
+        check_accs (AlexAccNone) = last_acc
+        check_accs (AlexAcc a  ) = AlexLastAcc a input (len)
+        check_accs (AlexAccSkip) = AlexLastSkip  input (len)
+
+        check_accs (AlexAccPred a predx rest)
+           | predx user orig_input (len) input
+           = AlexLastAcc a input (len)
+           | otherwise
+           = check_accs rest
+        check_accs (AlexAccSkipPred predx rest)
+           | predx user orig_input (len) input
+           = AlexLastSkip input (len)
+           | otherwise
+           = check_accs rest
+
+
+data AlexLastAcc a
+  = AlexNone
+  | AlexLastAcc a !AlexInput !Int
+  | AlexLastSkip  !AlexInput !Int
+
+instance Functor AlexLastAcc where
+    fmap _ AlexNone = AlexNone
+    fmap f (AlexLastAcc x y z) = AlexLastAcc (f x) y z
+    fmap _ (AlexLastSkip x y) = AlexLastSkip x y
+
+data AlexAcc a user
+  = AlexAccNone
+  | AlexAcc a
+  | AlexAccSkip
+
+  | AlexAccPred a   (AlexAccPred user) (AlexAcc a user)
+  | AlexAccSkipPred (AlexAccPred user) (AlexAcc a user)
+
+type AlexAccPred user = user -> AlexInput -> Int -> AlexInput -> Bool
+
+-- -----------------------------------------------------------------------------
+-- Predicates on a rule
+
+alexAndPred p1 p2 user in1 len in2
+  = p1 user in1 len in2 && p2 user in1 len in2
+
+--alexPrevCharIsPred :: Char -> AlexAccPred _ 
+alexPrevCharIs c _ input _ _ = c == alexInputPrevChar input
+
+alexPrevCharMatches f _ input _ _ = f (alexInputPrevChar input)
+
+--alexPrevCharIsOneOfPred :: Array Char Bool -> AlexAccPred _ 
+alexPrevCharIsOneOf arr _ input _ _ = arr ! alexInputPrevChar input
+
+--alexRightContext :: Int -> AlexAccPred _
+alexRightContext (sc) user _ _ input = 
+     case alex_scan_tkn user input (0) input sc AlexNone of
+          (AlexNone, _) -> False
+          _ -> True
+        -- TODO: there's no need to find the longest
+        -- match when checking the right context, just
+        -- the first match will do.
diff --git a/src/LexBNF.x b/src/LexBNF.x
--- a/src/LexBNF.x
+++ b/src/LexBNF.x
@@ -21,7 +21,7 @@
 $u = [\0-\255]          -- universal: any character
 
 @rsyms =    -- symbols and non-identifier-like reserved words
-   \: | \; | \. | \: \: \= | \[ | \] | \_ | \( | \) | \, | \= | \| | \- | \* | \+ | \? | \{ | \}
+   \: | \; | \, | \. | \: \: \= | \[ | \] | \_ | \( | \) | \= | \| | \- | \* | \+ | \? | \{ | \}
 
 :-
 "--" [.]* ; -- Toss single line comments
@@ -59,10 +59,12 @@
  | Err Posn
   deriving (Eq,Show,Ord)
 
+printPosn :: Posn -> String
+printPosn (Pn _ l c) = "line " ++ show l ++ ", column " ++ show c
+
 tokenPos :: [Token] -> String
-tokenPos (PT (Pn _ l _) _ :_) = "line " ++ show l
-tokenPos (Err (Pn _ l _) :_) = "line " ++ show l
-tokenPos _ = "end of file"
+tokenPos (t:_) = printPosn (tokenPosn t)
+tokenPos [] = "end of file"
 
 tokenPosn :: Token -> Posn
 tokenPosn (PT p _) = p
@@ -80,12 +82,12 @@
 prToken :: Token -> String
 prToken t = case t of
   PT _ (TS s _) -> s
-  PT _ (TL s)   -> s
+  PT _ (TL s)   -> show s
   PT _ (TI s)   -> s
   PT _ (TV s)   -> s
   PT _ (TD s)   -> s
   PT _ (TC s)   -> s
-  Err _ -> "#Error"
+  Err _         -> "#error"
 
 
 data BTree = N | B String Tok BTree BTree deriving (Show)
diff --git a/src/Main.hs b/src/Main.hs
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -22,7 +22,7 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
 -}
 
 
@@ -47,7 +47,7 @@
 
 import Data.Version ( showVersion )
 import System.Environment (getArgs)
-import System.Exit (exitFailure,exitSuccess)
+import System.Exit (exitFailure, exitSuccess)
 import System.IO (stderr, hPutStrLn)
 
 -- Print an error message and a (short) usage help and exit
diff --git a/src/ParBNF.hs b/src/ParBNF.hs
new file mode 100644
--- /dev/null
+++ b/src/ParBNF.hs
@@ -0,0 +1,3151 @@
+{-# OPTIONS_GHC -w #-}
+{-# OPTIONS_GHC -fno-warn-incomplete-patterns -fno-warn-overlapping-patterns #-}
+module ParBNF where
+import AbsBNF
+import LexBNF
+import ErrM
+import Control.Applicative(Applicative(..))
+import Control.Monad (ap)
+
+-- parser produced by Happy Version 1.19.5
+
+data HappyAbsSyn 
+	= HappyTerminal (Token)
+	| HappyErrorToken Int
+	| HappyAbsSyn36 (Ident)
+	| HappyAbsSyn37 (String)
+	| HappyAbsSyn38 (Integer)
+	| HappyAbsSyn39 (Char)
+	| HappyAbsSyn40 (Double)
+	| HappyAbsSyn41 (LGrammar)
+	| HappyAbsSyn42 (LDef)
+	| HappyAbsSyn43 ([LDef])
+	| HappyAbsSyn44 ([Ident])
+	| HappyAbsSyn45 (Grammar)
+	| HappyAbsSyn46 ([Def])
+	| HappyAbsSyn47 (Def)
+	| HappyAbsSyn48 (Item)
+	| HappyAbsSyn49 ([Item])
+	| HappyAbsSyn50 (Cat)
+	| HappyAbsSyn51 (Label)
+	| HappyAbsSyn52 (LabelId)
+	| HappyAbsSyn53 (ProfItem)
+	| HappyAbsSyn54 (IntList)
+	| HappyAbsSyn55 ([Integer])
+	| HappyAbsSyn56 ([IntList])
+	| HappyAbsSyn57 ([ProfItem])
+	| HappyAbsSyn58 (Arg)
+	| HappyAbsSyn59 ([Arg])
+	| HappyAbsSyn60 (Separation)
+	| HappyAbsSyn61 ([String])
+	| HappyAbsSyn62 (Exp)
+	| HappyAbsSyn65 ([Exp])
+	| HappyAbsSyn67 (RHS)
+	| HappyAbsSyn68 ([RHS])
+	| HappyAbsSyn69 (MinimumSize)
+	| HappyAbsSyn70 (Reg)
+
+{- to allow type-synonyms as our monads (likely
+ - with explicitly-specified bind and return)
+ - in Haskell98, it seems that with
+ - /type M a = .../, then /(HappyReduction M)/
+ - is not allowed.  But Happy is a
+ - code-generator that can just substitute it.
+type HappyReduction m = 
+	   Int 
+	-> (Token)
+	-> HappyState (Token) (HappyStk HappyAbsSyn -> [(Token)] -> m HappyAbsSyn)
+	-> [HappyState (Token) (HappyStk HappyAbsSyn -> [(Token)] -> m HappyAbsSyn)] 
+	-> HappyStk HappyAbsSyn 
+	-> [(Token)] -> m HappyAbsSyn
+-}
+
+action_0,
+ action_1,
+ action_2,
+ action_3,
+ action_4,
+ action_5,
+ action_6,
+ action_7,
+ action_8,
+ action_9,
+ action_10,
+ action_11,
+ action_12,
+ action_13,
+ action_14,
+ action_15,
+ action_16,
+ action_17,
+ action_18,
+ action_19,
+ action_20,
+ action_21,
+ action_22,
+ action_23,
+ action_24,
+ action_25,
+ action_26,
+ action_27,
+ action_28,
+ action_29,
+ action_30,
+ action_31,
+ action_32,
+ action_33,
+ action_34,
+ action_35,
+ action_36,
+ action_37,
+ action_38,
+ action_39,
+ action_40,
+ action_41,
+ action_42,
+ action_43,
+ action_44,
+ action_45,
+ action_46,
+ action_47,
+ action_48,
+ action_49,
+ action_50,
+ action_51,
+ action_52,
+ action_53,
+ action_54,
+ action_55,
+ action_56,
+ action_57,
+ action_58,
+ action_59,
+ action_60,
+ action_61,
+ action_62,
+ action_63,
+ action_64,
+ action_65,
+ action_66,
+ action_67,
+ action_68,
+ action_69,
+ action_70,
+ action_71,
+ action_72,
+ action_73,
+ action_74,
+ action_75,
+ action_76,
+ action_77,
+ action_78,
+ action_79,
+ action_80,
+ action_81,
+ action_82,
+ action_83,
+ action_84,
+ action_85,
+ action_86,
+ action_87,
+ action_88,
+ action_89,
+ action_90,
+ action_91,
+ action_92,
+ action_93,
+ action_94,
+ action_95,
+ action_96,
+ action_97,
+ action_98,
+ action_99,
+ action_100,
+ action_101,
+ action_102,
+ action_103,
+ action_104,
+ action_105,
+ action_106,
+ action_107,
+ action_108,
+ action_109,
+ action_110,
+ action_111,
+ action_112,
+ action_113,
+ action_114,
+ action_115,
+ action_116,
+ action_117,
+ action_118,
+ action_119,
+ action_120,
+ action_121,
+ action_122,
+ action_123,
+ action_124,
+ action_125,
+ action_126,
+ action_127,
+ action_128,
+ action_129,
+ action_130,
+ action_131,
+ action_132,
+ action_133,
+ action_134,
+ action_135,
+ action_136,
+ action_137,
+ action_138,
+ action_139,
+ action_140,
+ action_141,
+ action_142,
+ action_143,
+ action_144,
+ action_145,
+ action_146,
+ action_147,
+ action_148,
+ action_149,
+ action_150,
+ action_151,
+ action_152,
+ action_153,
+ action_154,
+ action_155,
+ action_156,
+ action_157,
+ action_158,
+ action_159,
+ action_160,
+ action_161,
+ action_162,
+ action_163,
+ action_164,
+ action_165,
+ action_166,
+ action_167,
+ action_168,
+ action_169,
+ action_170,
+ action_171,
+ action_172,
+ action_173,
+ action_174,
+ action_175,
+ action_176,
+ action_177,
+ action_178,
+ action_179,
+ action_180,
+ action_181,
+ action_182,
+ action_183,
+ action_184,
+ action_185,
+ action_186,
+ action_187,
+ action_188,
+ action_189,
+ action_190,
+ action_191,
+ action_192,
+ action_193,
+ action_194,
+ action_195,
+ action_196,
+ action_197,
+ action_198,
+ action_199,
+ action_200,
+ action_201,
+ action_202,
+ action_203,
+ action_204,
+ action_205,
+ action_206,
+ action_207,
+ action_208,
+ action_209,
+ action_210,
+ action_211,
+ action_212,
+ action_213,
+ action_214,
+ action_215,
+ action_216,
+ action_217,
+ action_218,
+ action_219,
+ action_220,
+ action_221,
+ action_222,
+ action_223,
+ action_224,
+ action_225,
+ action_226,
+ action_227,
+ action_228,
+ action_229,
+ action_230,
+ action_231,
+ action_232,
+ action_233,
+ action_234,
+ action_235,
+ action_236,
+ action_237,
+ action_238,
+ action_239,
+ action_240,
+ action_241,
+ action_242,
+ action_243,
+ action_244,
+ action_245,
+ action_246,
+ action_247,
+ action_248,
+ action_249,
+ action_250,
+ action_251,
+ action_252 :: () => Int -> ({-HappyReduction (Err) = -}
+	   Int 
+	-> (Token)
+	-> HappyState (Token) (HappyStk HappyAbsSyn -> [(Token)] -> (Err) HappyAbsSyn)
+	-> [HappyState (Token) (HappyStk HappyAbsSyn -> [(Token)] -> (Err) HappyAbsSyn)] 
+	-> HappyStk HappyAbsSyn 
+	-> [(Token)] -> (Err) HappyAbsSyn)
+
+happyReduce_33,
+ happyReduce_34,
+ happyReduce_35,
+ happyReduce_36,
+ happyReduce_37,
+ happyReduce_38,
+ happyReduce_39,
+ happyReduce_40,
+ happyReduce_41,
+ happyReduce_42,
+ happyReduce_43,
+ happyReduce_44,
+ happyReduce_45,
+ happyReduce_46,
+ happyReduce_47,
+ happyReduce_48,
+ happyReduce_49,
+ happyReduce_50,
+ happyReduce_51,
+ happyReduce_52,
+ happyReduce_53,
+ happyReduce_54,
+ happyReduce_55,
+ happyReduce_56,
+ happyReduce_57,
+ happyReduce_58,
+ happyReduce_59,
+ happyReduce_60,
+ happyReduce_61,
+ happyReduce_62,
+ happyReduce_63,
+ happyReduce_64,
+ happyReduce_65,
+ happyReduce_66,
+ happyReduce_67,
+ happyReduce_68,
+ happyReduce_69,
+ happyReduce_70,
+ happyReduce_71,
+ happyReduce_72,
+ happyReduce_73,
+ happyReduce_74,
+ happyReduce_75,
+ happyReduce_76,
+ happyReduce_77,
+ happyReduce_78,
+ happyReduce_79,
+ happyReduce_80,
+ happyReduce_81,
+ happyReduce_82,
+ happyReduce_83,
+ happyReduce_84,
+ happyReduce_85,
+ happyReduce_86,
+ happyReduce_87,
+ happyReduce_88,
+ happyReduce_89,
+ happyReduce_90,
+ happyReduce_91,
+ happyReduce_92,
+ happyReduce_93,
+ happyReduce_94,
+ happyReduce_95,
+ happyReduce_96,
+ happyReduce_97,
+ happyReduce_98,
+ happyReduce_99,
+ happyReduce_100,
+ happyReduce_101,
+ happyReduce_102,
+ happyReduce_103,
+ happyReduce_104,
+ happyReduce_105,
+ happyReduce_106,
+ happyReduce_107,
+ happyReduce_108,
+ happyReduce_109,
+ happyReduce_110,
+ happyReduce_111,
+ happyReduce_112,
+ happyReduce_113,
+ happyReduce_114,
+ happyReduce_115,
+ happyReduce_116,
+ happyReduce_117,
+ happyReduce_118,
+ happyReduce_119,
+ happyReduce_120,
+ happyReduce_121,
+ happyReduce_122,
+ happyReduce_123,
+ happyReduce_124,
+ happyReduce_125,
+ happyReduce_126,
+ happyReduce_127,
+ happyReduce_128,
+ happyReduce_129,
+ happyReduce_130,
+ happyReduce_131,
+ happyReduce_132,
+ happyReduce_133,
+ happyReduce_134,
+ happyReduce_135,
+ happyReduce_136,
+ happyReduce_137,
+ happyReduce_138,
+ happyReduce_139,
+ happyReduce_140,
+ happyReduce_141 :: () => ({-HappyReduction (Err) = -}
+	   Int 
+	-> (Token)
+	-> HappyState (Token) (HappyStk HappyAbsSyn -> [(Token)] -> (Err) HappyAbsSyn)
+	-> [HappyState (Token) (HappyStk HappyAbsSyn -> [(Token)] -> (Err) HappyAbsSyn)] 
+	-> HappyStk HappyAbsSyn 
+	-> [(Token)] -> (Err) HappyAbsSyn)
+
+action_0 (74) = happyShift action_99
+action_0 (83) = happyShift action_137
+action_0 (86) = happyShift action_100
+action_0 (88) = happyShift action_101
+action_0 (90) = happyShift action_113
+action_0 (91) = happyShift action_114
+action_0 (92) = happyShift action_115
+action_0 (93) = happyShift action_116
+action_0 (95) = happyShift action_117
+action_0 (97) = happyShift action_118
+action_0 (98) = happyShift action_119
+action_0 (102) = happyShift action_120
+action_0 (103) = happyShift action_121
+action_0 (104) = happyShift action_122
+action_0 (106) = happyShift action_123
+action_0 (107) = happyShift action_124
+action_0 (110) = happyShift action_138
+action_0 (114) = happyShift action_34
+action_0 (36) = happyGoto action_132
+action_0 (41) = happyGoto action_140
+action_0 (42) = happyGoto action_133
+action_0 (43) = happyGoto action_141
+action_0 (44) = happyGoto action_135
+action_0 (47) = happyGoto action_136
+action_0 (51) = happyGoto action_112
+action_0 (52) = happyGoto action_103
+action_0 _ = happyReduce_42
+
+action_1 (74) = happyShift action_99
+action_1 (86) = happyShift action_100
+action_1 (88) = happyShift action_101
+action_1 (90) = happyShift action_113
+action_1 (91) = happyShift action_114
+action_1 (92) = happyShift action_115
+action_1 (93) = happyShift action_116
+action_1 (95) = happyShift action_117
+action_1 (97) = happyShift action_118
+action_1 (98) = happyShift action_119
+action_1 (102) = happyShift action_120
+action_1 (103) = happyShift action_121
+action_1 (104) = happyShift action_122
+action_1 (106) = happyShift action_123
+action_1 (107) = happyShift action_124
+action_1 (110) = happyShift action_138
+action_1 (114) = happyShift action_34
+action_1 (36) = happyGoto action_132
+action_1 (42) = happyGoto action_139
+action_1 (44) = happyGoto action_135
+action_1 (47) = happyGoto action_136
+action_1 (51) = happyGoto action_112
+action_1 (52) = happyGoto action_103
+action_1 _ = happyFail
+
+action_2 (74) = happyShift action_99
+action_2 (83) = happyShift action_137
+action_2 (86) = happyShift action_100
+action_2 (88) = happyShift action_101
+action_2 (90) = happyShift action_113
+action_2 (91) = happyShift action_114
+action_2 (92) = happyShift action_115
+action_2 (93) = happyShift action_116
+action_2 (95) = happyShift action_117
+action_2 (97) = happyShift action_118
+action_2 (98) = happyShift action_119
+action_2 (102) = happyShift action_120
+action_2 (103) = happyShift action_121
+action_2 (104) = happyShift action_122
+action_2 (106) = happyShift action_123
+action_2 (107) = happyShift action_124
+action_2 (110) = happyShift action_138
+action_2 (114) = happyShift action_34
+action_2 (36) = happyGoto action_132
+action_2 (42) = happyGoto action_133
+action_2 (43) = happyGoto action_134
+action_2 (44) = happyGoto action_135
+action_2 (47) = happyGoto action_136
+action_2 (51) = happyGoto action_112
+action_2 (52) = happyGoto action_103
+action_2 _ = happyReduce_42
+
+action_3 (114) = happyShift action_34
+action_3 (36) = happyGoto action_130
+action_3 (44) = happyGoto action_131
+action_3 _ = happyFail
+
+action_4 (74) = happyShift action_99
+action_4 (83) = happyShift action_127
+action_4 (86) = happyShift action_100
+action_4 (88) = happyShift action_101
+action_4 (90) = happyShift action_113
+action_4 (91) = happyShift action_114
+action_4 (92) = happyShift action_115
+action_4 (93) = happyShift action_116
+action_4 (95) = happyShift action_117
+action_4 (97) = happyShift action_118
+action_4 (98) = happyShift action_119
+action_4 (102) = happyShift action_120
+action_4 (103) = happyShift action_121
+action_4 (104) = happyShift action_122
+action_4 (106) = happyShift action_123
+action_4 (107) = happyShift action_124
+action_4 (114) = happyShift action_34
+action_4 (36) = happyGoto action_97
+action_4 (45) = happyGoto action_128
+action_4 (46) = happyGoto action_129
+action_4 (47) = happyGoto action_126
+action_4 (51) = happyGoto action_112
+action_4 (52) = happyGoto action_103
+action_4 _ = happyReduce_49
+
+action_5 (74) = happyShift action_99
+action_5 (83) = happyShift action_127
+action_5 (86) = happyShift action_100
+action_5 (88) = happyShift action_101
+action_5 (90) = happyShift action_113
+action_5 (91) = happyShift action_114
+action_5 (92) = happyShift action_115
+action_5 (93) = happyShift action_116
+action_5 (95) = happyShift action_117
+action_5 (97) = happyShift action_118
+action_5 (98) = happyShift action_119
+action_5 (102) = happyShift action_120
+action_5 (103) = happyShift action_121
+action_5 (104) = happyShift action_122
+action_5 (106) = happyShift action_123
+action_5 (107) = happyShift action_124
+action_5 (114) = happyShift action_34
+action_5 (36) = happyGoto action_97
+action_5 (46) = happyGoto action_125
+action_5 (47) = happyGoto action_126
+action_5 (51) = happyGoto action_112
+action_5 (52) = happyGoto action_103
+action_5 _ = happyReduce_49
+
+action_6 (74) = happyShift action_99
+action_6 (86) = happyShift action_100
+action_6 (88) = happyShift action_101
+action_6 (90) = happyShift action_113
+action_6 (91) = happyShift action_114
+action_6 (92) = happyShift action_115
+action_6 (93) = happyShift action_116
+action_6 (95) = happyShift action_117
+action_6 (97) = happyShift action_118
+action_6 (98) = happyShift action_119
+action_6 (102) = happyShift action_120
+action_6 (103) = happyShift action_121
+action_6 (104) = happyShift action_122
+action_6 (106) = happyShift action_123
+action_6 (107) = happyShift action_124
+action_6 (114) = happyShift action_34
+action_6 (36) = happyGoto action_97
+action_6 (47) = happyGoto action_111
+action_6 (51) = happyGoto action_112
+action_6 (52) = happyGoto action_103
+action_6 _ = happyFail
+
+action_7 (86) = happyShift action_106
+action_7 (114) = happyShift action_34
+action_7 (115) = happyShift action_68
+action_7 (36) = happyGoto action_104
+action_7 (37) = happyGoto action_108
+action_7 (48) = happyGoto action_109
+action_7 (50) = happyGoto action_110
+action_7 _ = happyFail
+
+action_8 (49) = happyGoto action_107
+action_8 _ = happyReduce_71
+
+action_9 (86) = happyShift action_106
+action_9 (114) = happyShift action_34
+action_9 (36) = happyGoto action_104
+action_9 (50) = happyGoto action_105
+action_9 _ = happyFail
+
+action_10 (74) = happyShift action_99
+action_10 (86) = happyShift action_100
+action_10 (88) = happyShift action_101
+action_10 (114) = happyShift action_34
+action_10 (36) = happyGoto action_97
+action_10 (51) = happyGoto action_102
+action_10 (52) = happyGoto action_103
+action_10 _ = happyFail
+
+action_11 (74) = happyShift action_99
+action_11 (86) = happyShift action_100
+action_11 (88) = happyShift action_101
+action_11 (114) = happyShift action_34
+action_11 (36) = happyGoto action_97
+action_11 (52) = happyGoto action_98
+action_11 _ = happyFail
+
+action_12 (74) = happyShift action_89
+action_12 (53) = happyGoto action_96
+action_12 _ = happyFail
+
+action_13 (86) = happyShift action_92
+action_13 (54) = happyGoto action_95
+action_13 _ = happyFail
+
+action_14 (116) = happyShift action_69
+action_14 (38) = happyGoto action_93
+action_14 (55) = happyGoto action_94
+action_14 _ = happyReduce_86
+
+action_15 (86) = happyShift action_92
+action_15 (54) = happyGoto action_90
+action_15 (56) = happyGoto action_91
+action_15 _ = happyReduce_89
+
+action_16 (74) = happyShift action_89
+action_16 (53) = happyGoto action_87
+action_16 (57) = happyGoto action_88
+action_16 _ = happyFail
+
+action_17 (114) = happyShift action_34
+action_17 (36) = happyGoto action_85
+action_17 (58) = happyGoto action_86
+action_17 _ = happyFail
+
+action_18 (59) = happyGoto action_84
+action_18 _ = happyReduce_95
+
+action_19 (104) = happyShift action_82
+action_19 (106) = happyShift action_83
+action_19 (60) = happyGoto action_81
+action_19 _ = happyReduce_97
+
+action_20 (115) = happyShift action_68
+action_20 (37) = happyGoto action_79
+action_20 (61) = happyGoto action_80
+action_20 _ = happyFail
+
+action_21 (74) = happyShift action_66
+action_21 (86) = happyShift action_67
+action_21 (114) = happyShift action_34
+action_21 (115) = happyShift action_68
+action_21 (116) = happyShift action_69
+action_21 (117) = happyShift action_49
+action_21 (118) = happyShift action_70
+action_21 (36) = happyGoto action_71
+action_21 (37) = happyGoto action_60
+action_21 (38) = happyGoto action_61
+action_21 (39) = happyGoto action_62
+action_21 (40) = happyGoto action_63
+action_21 (62) = happyGoto action_78
+action_21 (63) = happyGoto action_73
+action_21 (64) = happyGoto action_74
+action_21 _ = happyFail
+
+action_22 (74) = happyShift action_66
+action_22 (86) = happyShift action_67
+action_22 (114) = happyShift action_34
+action_22 (115) = happyShift action_68
+action_22 (116) = happyShift action_69
+action_22 (117) = happyShift action_49
+action_22 (118) = happyShift action_70
+action_22 (36) = happyGoto action_71
+action_22 (37) = happyGoto action_60
+action_22 (38) = happyGoto action_61
+action_22 (39) = happyGoto action_62
+action_22 (40) = happyGoto action_63
+action_22 (63) = happyGoto action_77
+action_22 (64) = happyGoto action_74
+action_22 _ = happyFail
+
+action_23 (74) = happyShift action_66
+action_23 (86) = happyShift action_67
+action_23 (114) = happyShift action_34
+action_23 (115) = happyShift action_68
+action_23 (116) = happyShift action_69
+action_23 (117) = happyShift action_49
+action_23 (118) = happyShift action_70
+action_23 (36) = happyGoto action_59
+action_23 (37) = happyGoto action_60
+action_23 (38) = happyGoto action_61
+action_23 (39) = happyGoto action_62
+action_23 (40) = happyGoto action_63
+action_23 (64) = happyGoto action_76
+action_23 _ = happyFail
+
+action_24 (74) = happyShift action_66
+action_24 (86) = happyShift action_67
+action_24 (114) = happyShift action_34
+action_24 (115) = happyShift action_68
+action_24 (116) = happyShift action_69
+action_24 (117) = happyShift action_49
+action_24 (118) = happyShift action_70
+action_24 (36) = happyGoto action_71
+action_24 (37) = happyGoto action_60
+action_24 (38) = happyGoto action_61
+action_24 (39) = happyGoto action_62
+action_24 (40) = happyGoto action_63
+action_24 (62) = happyGoto action_72
+action_24 (63) = happyGoto action_73
+action_24 (64) = happyGoto action_74
+action_24 (65) = happyGoto action_75
+action_24 _ = happyReduce_113
+
+action_25 (74) = happyShift action_66
+action_25 (86) = happyShift action_67
+action_25 (114) = happyShift action_34
+action_25 (115) = happyShift action_68
+action_25 (116) = happyShift action_69
+action_25 (117) = happyShift action_49
+action_25 (118) = happyShift action_70
+action_25 (36) = happyGoto action_59
+action_25 (37) = happyGoto action_60
+action_25 (38) = happyGoto action_61
+action_25 (39) = happyGoto action_62
+action_25 (40) = happyGoto action_63
+action_25 (64) = happyGoto action_64
+action_25 (66) = happyGoto action_65
+action_25 _ = happyFail
+
+action_26 (49) = happyGoto action_55
+action_26 (67) = happyGoto action_58
+action_26 _ = happyReduce_71
+
+action_27 (49) = happyGoto action_55
+action_27 (67) = happyGoto action_56
+action_27 (68) = happyGoto action_57
+action_27 _ = happyReduce_71
+
+action_28 (101) = happyShift action_54
+action_28 (69) = happyGoto action_53
+action_28 _ = happyReduce_122
+
+action_29 (74) = happyShift action_40
+action_29 (86) = happyShift action_41
+action_29 (89) = happyShift action_42
+action_29 (94) = happyShift action_43
+action_29 (96) = happyShift action_44
+action_29 (99) = happyShift action_45
+action_29 (100) = happyShift action_46
+action_29 (109) = happyShift action_47
+action_29 (111) = happyShift action_48
+action_29 (117) = happyShift action_49
+action_29 (39) = happyGoto action_35
+action_29 (70) = happyGoto action_52
+action_29 (72) = happyGoto action_38
+action_29 _ = happyFail
+
+action_30 (74) = happyShift action_40
+action_30 (86) = happyShift action_41
+action_30 (89) = happyShift action_42
+action_30 (94) = happyShift action_43
+action_30 (96) = happyShift action_44
+action_30 (99) = happyShift action_45
+action_30 (100) = happyShift action_46
+action_30 (109) = happyShift action_47
+action_30 (111) = happyShift action_48
+action_30 (117) = happyShift action_49
+action_30 (39) = happyGoto action_35
+action_30 (70) = happyGoto action_36
+action_30 (71) = happyGoto action_51
+action_30 (72) = happyGoto action_38
+action_30 _ = happyFail
+
+action_31 (74) = happyShift action_40
+action_31 (86) = happyShift action_41
+action_31 (89) = happyShift action_42
+action_31 (94) = happyShift action_43
+action_31 (96) = happyShift action_44
+action_31 (99) = happyShift action_45
+action_31 (100) = happyShift action_46
+action_31 (109) = happyShift action_47
+action_31 (111) = happyShift action_48
+action_31 (117) = happyShift action_49
+action_31 (39) = happyGoto action_35
+action_31 (72) = happyGoto action_50
+action_31 _ = happyFail
+
+action_32 (74) = happyShift action_40
+action_32 (86) = happyShift action_41
+action_32 (89) = happyShift action_42
+action_32 (94) = happyShift action_43
+action_32 (96) = happyShift action_44
+action_32 (99) = happyShift action_45
+action_32 (100) = happyShift action_46
+action_32 (109) = happyShift action_47
+action_32 (111) = happyShift action_48
+action_32 (117) = happyShift action_49
+action_32 (39) = happyGoto action_35
+action_32 (70) = happyGoto action_36
+action_32 (71) = happyGoto action_37
+action_32 (72) = happyGoto action_38
+action_32 (73) = happyGoto action_39
+action_32 _ = happyFail
+
+action_33 (114) = happyShift action_34
+action_33 _ = happyFail
+
+action_34 _ = happyReduce_33
+
+action_35 _ = happyReduce_132
+
+action_36 (74) = happyShift action_40
+action_36 (79) = happyShift action_195
+action_36 (86) = happyShift action_41
+action_36 (89) = happyShift action_42
+action_36 (94) = happyShift action_43
+action_36 (96) = happyShift action_44
+action_36 (99) = happyShift action_45
+action_36 (100) = happyShift action_46
+action_36 (109) = happyShift action_47
+action_36 (111) = happyShift action_48
+action_36 (117) = happyShift action_49
+action_36 (39) = happyGoto action_35
+action_36 (72) = happyGoto action_187
+action_36 _ = happyReduce_127
+
+action_37 (112) = happyShift action_188
+action_37 _ = happyReduce_141
+
+action_38 (76) = happyShift action_189
+action_38 (77) = happyShift action_190
+action_38 (85) = happyShift action_191
+action_38 _ = happyReduce_124
+
+action_39 (119) = happyAccept
+action_39 _ = happyFail
+
+action_40 (74) = happyShift action_40
+action_40 (86) = happyShift action_41
+action_40 (89) = happyShift action_42
+action_40 (94) = happyShift action_43
+action_40 (96) = happyShift action_44
+action_40 (99) = happyShift action_45
+action_40 (100) = happyShift action_46
+action_40 (109) = happyShift action_47
+action_40 (111) = happyShift action_48
+action_40 (117) = happyShift action_49
+action_40 (39) = happyGoto action_35
+action_40 (70) = happyGoto action_36
+action_40 (71) = happyGoto action_37
+action_40 (72) = happyGoto action_38
+action_40 (73) = happyGoto action_194
+action_40 _ = happyFail
+
+action_41 (115) = happyShift action_68
+action_41 (37) = happyGoto action_193
+action_41 _ = happyFail
+
+action_42 _ = happyReduce_139
+
+action_43 _ = happyReduce_135
+
+action_44 _ = happyReduce_131
+
+action_45 _ = happyReduce_136
+
+action_46 _ = happyReduce_138
+
+action_47 _ = happyReduce_137
+
+action_48 (115) = happyShift action_68
+action_48 (37) = happyGoto action_192
+action_48 _ = happyFail
+
+action_49 _ = happyReduce_36
+
+action_50 (76) = happyShift action_189
+action_50 (77) = happyShift action_190
+action_50 (85) = happyShift action_191
+action_50 (119) = happyAccept
+action_50 _ = happyFail
+
+action_51 (112) = happyShift action_188
+action_51 (119) = happyAccept
+action_51 _ = happyFail
+
+action_52 (74) = happyShift action_40
+action_52 (86) = happyShift action_41
+action_52 (89) = happyShift action_42
+action_52 (94) = happyShift action_43
+action_52 (96) = happyShift action_44
+action_52 (99) = happyShift action_45
+action_52 (100) = happyShift action_46
+action_52 (109) = happyShift action_47
+action_52 (111) = happyShift action_48
+action_52 (117) = happyShift action_49
+action_52 (119) = happyAccept
+action_52 (39) = happyGoto action_35
+action_52 (72) = happyGoto action_187
+action_52 _ = happyFail
+
+action_53 (119) = happyAccept
+action_53 _ = happyFail
+
+action_54 _ = happyReduce_121
+
+action_55 (86) = happyShift action_106
+action_55 (114) = happyShift action_34
+action_55 (115) = happyShift action_68
+action_55 (36) = happyGoto action_104
+action_55 (37) = happyGoto action_108
+action_55 (48) = happyGoto action_164
+action_55 (50) = happyGoto action_110
+action_55 _ = happyReduce_118
+
+action_56 (112) = happyShift action_186
+action_56 _ = happyReduce_119
+
+action_57 (119) = happyAccept
+action_57 _ = happyFail
+
+action_58 (119) = happyAccept
+action_58 _ = happyFail
+
+action_59 _ = happyReduce_106
+
+action_60 _ = happyReduce_109
+
+action_61 _ = happyReduce_107
+
+action_62 _ = happyReduce_108
+
+action_63 _ = happyReduce_110
+
+action_64 (74) = happyShift action_66
+action_64 (86) = happyShift action_67
+action_64 (114) = happyShift action_34
+action_64 (115) = happyShift action_68
+action_64 (116) = happyShift action_69
+action_64 (117) = happyShift action_49
+action_64 (118) = happyShift action_70
+action_64 (36) = happyGoto action_59
+action_64 (37) = happyGoto action_60
+action_64 (38) = happyGoto action_61
+action_64 (39) = happyGoto action_62
+action_64 (40) = happyGoto action_63
+action_64 (64) = happyGoto action_64
+action_64 (66) = happyGoto action_185
+action_64 _ = happyReduce_116
+
+action_65 (119) = happyAccept
+action_65 _ = happyFail
+
+action_66 (74) = happyShift action_66
+action_66 (86) = happyShift action_67
+action_66 (114) = happyShift action_34
+action_66 (115) = happyShift action_68
+action_66 (116) = happyShift action_69
+action_66 (117) = happyShift action_49
+action_66 (118) = happyShift action_70
+action_66 (36) = happyGoto action_71
+action_66 (37) = happyGoto action_60
+action_66 (38) = happyGoto action_61
+action_66 (39) = happyGoto action_62
+action_66 (40) = happyGoto action_63
+action_66 (62) = happyGoto action_184
+action_66 (63) = happyGoto action_73
+action_66 (64) = happyGoto action_74
+action_66 _ = happyFail
+
+action_67 (74) = happyShift action_66
+action_67 (86) = happyShift action_67
+action_67 (114) = happyShift action_34
+action_67 (115) = happyShift action_68
+action_67 (116) = happyShift action_69
+action_67 (117) = happyShift action_49
+action_67 (118) = happyShift action_70
+action_67 (36) = happyGoto action_71
+action_67 (37) = happyGoto action_60
+action_67 (38) = happyGoto action_61
+action_67 (39) = happyGoto action_62
+action_67 (40) = happyGoto action_63
+action_67 (62) = happyGoto action_72
+action_67 (63) = happyGoto action_73
+action_67 (64) = happyGoto action_74
+action_67 (65) = happyGoto action_183
+action_67 _ = happyReduce_113
+
+action_68 _ = happyReduce_34
+
+action_69 _ = happyReduce_35
+
+action_70 _ = happyReduce_37
+
+action_71 (74) = happyShift action_66
+action_71 (86) = happyShift action_67
+action_71 (114) = happyShift action_34
+action_71 (115) = happyShift action_68
+action_71 (116) = happyShift action_69
+action_71 (117) = happyShift action_49
+action_71 (118) = happyShift action_70
+action_71 (36) = happyGoto action_59
+action_71 (37) = happyGoto action_60
+action_71 (38) = happyGoto action_61
+action_71 (39) = happyGoto action_62
+action_71 (40) = happyGoto action_63
+action_71 (64) = happyGoto action_64
+action_71 (66) = happyGoto action_182
+action_71 _ = happyReduce_106
+
+action_72 (78) = happyShift action_181
+action_72 _ = happyReduce_114
+
+action_73 (81) = happyShift action_180
+action_73 _ = happyReduce_103
+
+action_74 _ = happyReduce_105
+
+action_75 (119) = happyAccept
+action_75 _ = happyFail
+
+action_76 (119) = happyAccept
+action_76 _ = happyFail
+
+action_77 (119) = happyAccept
+action_77 _ = happyFail
+
+action_78 (119) = happyAccept
+action_78 _ = happyFail
+
+action_79 (78) = happyShift action_179
+action_79 _ = happyReduce_100
+
+action_80 (119) = happyAccept
+action_80 _ = happyFail
+
+action_81 (119) = happyAccept
+action_81 _ = happyFail
+
+action_82 (115) = happyShift action_68
+action_82 (37) = happyGoto action_178
+action_82 _ = happyFail
+
+action_83 (115) = happyShift action_68
+action_83 (37) = happyGoto action_177
+action_83 _ = happyFail
+
+action_84 (114) = happyShift action_34
+action_84 (119) = happyAccept
+action_84 (36) = happyGoto action_85
+action_84 (58) = happyGoto action_176
+action_84 _ = happyFail
+
+action_85 _ = happyReduce_94
+
+action_86 (119) = happyAccept
+action_86 _ = happyFail
+
+action_87 (74) = happyShift action_89
+action_87 (53) = happyGoto action_87
+action_87 (57) = happyGoto action_175
+action_87 _ = happyReduce_92
+
+action_88 (119) = happyAccept
+action_88 _ = happyFail
+
+action_89 (86) = happyShift action_174
+action_89 _ = happyFail
+
+action_90 (78) = happyShift action_173
+action_90 _ = happyReduce_90
+
+action_91 (119) = happyAccept
+action_91 _ = happyFail
+
+action_92 (116) = happyShift action_69
+action_92 (38) = happyGoto action_93
+action_92 (55) = happyGoto action_172
+action_92 _ = happyReduce_86
+
+action_93 (78) = happyShift action_171
+action_93 _ = happyReduce_87
+
+action_94 (119) = happyAccept
+action_94 _ = happyFail
+
+action_95 (119) = happyAccept
+action_95 _ = happyFail
+
+action_96 (119) = happyAccept
+action_96 _ = happyFail
+
+action_97 _ = happyReduce_79
+
+action_98 (119) = happyAccept
+action_98 _ = happyFail
+
+action_99 (81) = happyShift action_170
+action_99 _ = happyFail
+
+action_100 (87) = happyShift action_169
+action_100 _ = happyFail
+
+action_101 _ = happyReduce_80
+
+action_102 (119) = happyAccept
+action_102 _ = happyFail
+
+action_103 (74) = happyShift action_168
+action_103 (86) = happyShift action_100
+action_103 (88) = happyShift action_101
+action_103 (114) = happyShift action_34
+action_103 (36) = happyGoto action_97
+action_103 (52) = happyGoto action_166
+action_103 (53) = happyGoto action_87
+action_103 (57) = happyGoto action_167
+action_103 _ = happyReduce_75
+
+action_104 _ = happyReduce_74
+
+action_105 (119) = happyAccept
+action_105 _ = happyFail
+
+action_106 (86) = happyShift action_106
+action_106 (114) = happyShift action_34
+action_106 (36) = happyGoto action_104
+action_106 (50) = happyGoto action_165
+action_106 _ = happyFail
+
+action_107 (86) = happyShift action_106
+action_107 (114) = happyShift action_34
+action_107 (115) = happyShift action_68
+action_107 (119) = happyAccept
+action_107 (36) = happyGoto action_104
+action_107 (37) = happyGoto action_108
+action_107 (48) = happyGoto action_164
+action_107 (50) = happyGoto action_110
+action_107 _ = happyFail
+
+action_108 _ = happyReduce_69
+
+action_109 (119) = happyAccept
+action_109 _ = happyFail
+
+action_110 _ = happyReduce_70
+
+action_111 (119) = happyAccept
+action_111 _ = happyFail
+
+action_112 (80) = happyShift action_163
+action_112 _ = happyFail
+
+action_113 (114) = happyShift action_34
+action_113 (36) = happyGoto action_162
+action_113 _ = happyFail
+
+action_114 (115) = happyShift action_68
+action_114 (37) = happyGoto action_161
+action_114 _ = happyFail
+
+action_115 (114) = happyShift action_34
+action_115 (36) = happyGoto action_160
+action_115 _ = happyFail
+
+action_116 (86) = happyShift action_106
+action_116 (114) = happyShift action_34
+action_116 (36) = happyGoto action_104
+action_116 (50) = happyGoto action_159
+action_116 _ = happyFail
+
+action_117 (114) = happyShift action_34
+action_117 (36) = happyGoto action_130
+action_117 (44) = happyGoto action_158
+action_117 _ = happyFail
+
+action_118 (74) = happyShift action_99
+action_118 (86) = happyShift action_100
+action_118 (88) = happyShift action_101
+action_118 (114) = happyShift action_34
+action_118 (36) = happyGoto action_97
+action_118 (51) = happyGoto action_157
+action_118 (52) = happyGoto action_103
+action_118 _ = happyFail
+
+action_119 (105) = happyShift action_155
+action_119 (108) = happyShift action_156
+action_119 (115) = happyShift action_68
+action_119 (37) = happyGoto action_79
+action_119 (61) = happyGoto action_154
+action_119 _ = happyFail
+
+action_120 (107) = happyShift action_153
+action_120 _ = happyFail
+
+action_121 (114) = happyShift action_34
+action_121 (36) = happyGoto action_152
+action_121 _ = happyFail
+
+action_122 (101) = happyShift action_54
+action_122 (69) = happyGoto action_151
+action_122 _ = happyReduce_122
+
+action_123 (101) = happyShift action_54
+action_123 (69) = happyGoto action_150
+action_123 _ = happyReduce_122
+
+action_124 (114) = happyShift action_34
+action_124 (36) = happyGoto action_149
+action_124 _ = happyFail
+
+action_125 (119) = happyAccept
+action_125 _ = happyFail
+
+action_126 (83) = happyShift action_148
+action_126 _ = happyReduce_50
+
+action_127 (74) = happyShift action_99
+action_127 (83) = happyShift action_127
+action_127 (86) = happyShift action_100
+action_127 (88) = happyShift action_101
+action_127 (90) = happyShift action_113
+action_127 (91) = happyShift action_114
+action_127 (92) = happyShift action_115
+action_127 (93) = happyShift action_116
+action_127 (95) = happyShift action_117
+action_127 (97) = happyShift action_118
+action_127 (98) = happyShift action_119
+action_127 (102) = happyShift action_120
+action_127 (103) = happyShift action_121
+action_127 (104) = happyShift action_122
+action_127 (106) = happyShift action_123
+action_127 (107) = happyShift action_124
+action_127 (114) = happyShift action_34
+action_127 (36) = happyGoto action_97
+action_127 (46) = happyGoto action_147
+action_127 (47) = happyGoto action_126
+action_127 (51) = happyGoto action_112
+action_127 (52) = happyGoto action_103
+action_127 _ = happyReduce_49
+
+action_128 (119) = happyAccept
+action_128 _ = happyFail
+
+action_129 _ = happyReduce_48
+
+action_130 (78) = happyShift action_146
+action_130 _ = happyReduce_46
+
+action_131 (119) = happyAccept
+action_131 _ = happyFail
+
+action_132 (78) = happyShift action_146
+action_132 (81) = happyReduce_46
+action_132 _ = happyReduce_79
+
+action_133 (83) = happyShift action_145
+action_133 _ = happyReduce_43
+
+action_134 (119) = happyAccept
+action_134 _ = happyFail
+
+action_135 (81) = happyShift action_144
+action_135 _ = happyFail
+
+action_136 _ = happyReduce_39
+
+action_137 (74) = happyShift action_99
+action_137 (83) = happyShift action_137
+action_137 (86) = happyShift action_100
+action_137 (88) = happyShift action_101
+action_137 (90) = happyShift action_113
+action_137 (91) = happyShift action_114
+action_137 (92) = happyShift action_115
+action_137 (93) = happyShift action_116
+action_137 (95) = happyShift action_117
+action_137 (97) = happyShift action_118
+action_137 (98) = happyShift action_119
+action_137 (102) = happyShift action_120
+action_137 (103) = happyShift action_121
+action_137 (104) = happyShift action_122
+action_137 (106) = happyShift action_123
+action_137 (107) = happyShift action_124
+action_137 (110) = happyShift action_138
+action_137 (114) = happyShift action_34
+action_137 (36) = happyGoto action_132
+action_137 (42) = happyGoto action_133
+action_137 (43) = happyGoto action_143
+action_137 (44) = happyGoto action_135
+action_137 (47) = happyGoto action_136
+action_137 (51) = happyGoto action_112
+action_137 (52) = happyGoto action_103
+action_137 _ = happyReduce_42
+
+action_138 (114) = happyShift action_34
+action_138 (36) = happyGoto action_130
+action_138 (44) = happyGoto action_142
+action_138 _ = happyFail
+
+action_139 (119) = happyAccept
+action_139 _ = happyFail
+
+action_140 (119) = happyAccept
+action_140 _ = happyFail
+
+action_141 _ = happyReduce_38
+
+action_142 _ = happyReduce_41
+
+action_143 _ = happyReduce_45
+
+action_144 (74) = happyShift action_99
+action_144 (86) = happyShift action_100
+action_144 (88) = happyShift action_101
+action_144 (90) = happyShift action_113
+action_144 (91) = happyShift action_114
+action_144 (92) = happyShift action_115
+action_144 (93) = happyShift action_116
+action_144 (95) = happyShift action_117
+action_144 (97) = happyShift action_118
+action_144 (98) = happyShift action_119
+action_144 (102) = happyShift action_120
+action_144 (103) = happyShift action_121
+action_144 (104) = happyShift action_122
+action_144 (106) = happyShift action_123
+action_144 (107) = happyShift action_124
+action_144 (114) = happyShift action_34
+action_144 (36) = happyGoto action_97
+action_144 (47) = happyGoto action_230
+action_144 (51) = happyGoto action_112
+action_144 (52) = happyGoto action_103
+action_144 _ = happyFail
+
+action_145 (74) = happyShift action_99
+action_145 (83) = happyShift action_137
+action_145 (86) = happyShift action_100
+action_145 (88) = happyShift action_101
+action_145 (90) = happyShift action_113
+action_145 (91) = happyShift action_114
+action_145 (92) = happyShift action_115
+action_145 (93) = happyShift action_116
+action_145 (95) = happyShift action_117
+action_145 (97) = happyShift action_118
+action_145 (98) = happyShift action_119
+action_145 (102) = happyShift action_120
+action_145 (103) = happyShift action_121
+action_145 (104) = happyShift action_122
+action_145 (106) = happyShift action_123
+action_145 (107) = happyShift action_124
+action_145 (110) = happyShift action_138
+action_145 (114) = happyShift action_34
+action_145 (36) = happyGoto action_132
+action_145 (42) = happyGoto action_133
+action_145 (43) = happyGoto action_229
+action_145 (44) = happyGoto action_135
+action_145 (47) = happyGoto action_136
+action_145 (51) = happyGoto action_112
+action_145 (52) = happyGoto action_103
+action_145 _ = happyReduce_42
+
+action_146 (114) = happyShift action_34
+action_146 (36) = happyGoto action_130
+action_146 (44) = happyGoto action_228
+action_146 _ = happyFail
+
+action_147 _ = happyReduce_52
+
+action_148 (74) = happyShift action_99
+action_148 (83) = happyShift action_127
+action_148 (86) = happyShift action_100
+action_148 (88) = happyShift action_101
+action_148 (90) = happyShift action_113
+action_148 (91) = happyShift action_114
+action_148 (92) = happyShift action_115
+action_148 (93) = happyShift action_116
+action_148 (95) = happyShift action_117
+action_148 (97) = happyShift action_118
+action_148 (98) = happyShift action_119
+action_148 (102) = happyShift action_120
+action_148 (103) = happyShift action_121
+action_148 (104) = happyShift action_122
+action_148 (106) = happyShift action_123
+action_148 (107) = happyShift action_124
+action_148 (114) = happyShift action_34
+action_148 (36) = happyGoto action_97
+action_148 (46) = happyGoto action_227
+action_148 (47) = happyGoto action_126
+action_148 (51) = happyGoto action_112
+action_148 (52) = happyGoto action_103
+action_148 _ = happyReduce_49
+
+action_149 (74) = happyShift action_40
+action_149 (86) = happyShift action_41
+action_149 (89) = happyShift action_42
+action_149 (94) = happyShift action_43
+action_149 (96) = happyShift action_44
+action_149 (99) = happyShift action_45
+action_149 (100) = happyShift action_46
+action_149 (109) = happyShift action_47
+action_149 (111) = happyShift action_48
+action_149 (117) = happyShift action_49
+action_149 (39) = happyGoto action_35
+action_149 (70) = happyGoto action_36
+action_149 (71) = happyGoto action_37
+action_149 (72) = happyGoto action_38
+action_149 (73) = happyGoto action_226
+action_149 _ = happyFail
+
+action_150 (86) = happyShift action_106
+action_150 (114) = happyShift action_34
+action_150 (36) = happyGoto action_104
+action_150 (50) = happyGoto action_225
+action_150 _ = happyFail
+
+action_151 (86) = happyShift action_106
+action_151 (114) = happyShift action_34
+action_151 (36) = happyGoto action_104
+action_151 (50) = happyGoto action_224
+action_151 _ = happyFail
+
+action_152 (82) = happyShift action_223
+action_152 _ = happyFail
+
+action_153 (114) = happyShift action_34
+action_153 (36) = happyGoto action_222
+action_153 _ = happyFail
+
+action_154 _ = happyReduce_66
+
+action_155 (115) = happyShift action_68
+action_155 (37) = happyGoto action_79
+action_155 (61) = happyGoto action_221
+action_155 _ = happyFail
+
+action_156 _ = happyReduce_68
+
+action_157 (80) = happyShift action_220
+action_157 _ = happyFail
+
+action_158 _ = happyReduce_59
+
+action_159 (115) = happyShift action_68
+action_159 (37) = happyGoto action_219
+action_159 _ = happyFail
+
+action_160 (59) = happyGoto action_218
+action_160 _ = happyReduce_95
+
+action_161 (115) = happyShift action_68
+action_161 (37) = happyGoto action_217
+action_161 _ = happyReduce_54
+
+action_162 (116) = happyShift action_69
+action_162 (38) = happyGoto action_216
+action_162 _ = happyFail
+
+action_163 (86) = happyShift action_106
+action_163 (114) = happyShift action_34
+action_163 (36) = happyGoto action_104
+action_163 (50) = happyGoto action_215
+action_163 _ = happyFail
+
+action_164 _ = happyReduce_72
+
+action_165 (87) = happyShift action_214
+action_165 _ = happyFail
+
+action_166 (74) = happyShift action_89
+action_166 (53) = happyGoto action_87
+action_166 (57) = happyGoto action_213
+action_166 _ = happyReduce_78
+
+action_167 _ = happyReduce_76
+
+action_168 (81) = happyShift action_170
+action_168 (86) = happyShift action_174
+action_168 _ = happyFail
+
+action_169 _ = happyReduce_81
+
+action_170 (75) = happyShift action_211
+action_170 (86) = happyShift action_212
+action_170 _ = happyFail
+
+action_171 (116) = happyShift action_69
+action_171 (38) = happyGoto action_93
+action_171 (55) = happyGoto action_210
+action_171 _ = happyReduce_86
+
+action_172 (87) = happyShift action_209
+action_172 _ = happyFail
+
+action_173 (86) = happyShift action_92
+action_173 (54) = happyGoto action_90
+action_173 (56) = happyGoto action_208
+action_173 _ = happyReduce_89
+
+action_174 (86) = happyShift action_92
+action_174 (54) = happyGoto action_90
+action_174 (56) = happyGoto action_207
+action_174 _ = happyReduce_89
+
+action_175 _ = happyReduce_93
+
+action_176 _ = happyReduce_96
+
+action_177 _ = happyReduce_98
+
+action_178 _ = happyReduce_99
+
+action_179 (115) = happyShift action_68
+action_179 (37) = happyGoto action_79
+action_179 (61) = happyGoto action_206
+action_179 _ = happyFail
+
+action_180 (74) = happyShift action_66
+action_180 (86) = happyShift action_67
+action_180 (114) = happyShift action_34
+action_180 (115) = happyShift action_68
+action_180 (116) = happyShift action_69
+action_180 (117) = happyShift action_49
+action_180 (118) = happyShift action_70
+action_180 (36) = happyGoto action_71
+action_180 (37) = happyGoto action_60
+action_180 (38) = happyGoto action_61
+action_180 (39) = happyGoto action_62
+action_180 (40) = happyGoto action_63
+action_180 (62) = happyGoto action_205
+action_180 (63) = happyGoto action_73
+action_180 (64) = happyGoto action_74
+action_180 _ = happyFail
+
+action_181 (74) = happyShift action_66
+action_181 (86) = happyShift action_67
+action_181 (114) = happyShift action_34
+action_181 (115) = happyShift action_68
+action_181 (116) = happyShift action_69
+action_181 (117) = happyShift action_49
+action_181 (118) = happyShift action_70
+action_181 (36) = happyGoto action_71
+action_181 (37) = happyGoto action_60
+action_181 (38) = happyGoto action_61
+action_181 (39) = happyGoto action_62
+action_181 (40) = happyGoto action_63
+action_181 (62) = happyGoto action_72
+action_181 (63) = happyGoto action_73
+action_181 (64) = happyGoto action_74
+action_181 (65) = happyGoto action_204
+action_181 _ = happyReduce_113
+
+action_182 _ = happyReduce_104
+
+action_183 (87) = happyShift action_203
+action_183 _ = happyFail
+
+action_184 (75) = happyShift action_202
+action_184 _ = happyFail
+
+action_185 _ = happyReduce_117
+
+action_186 (49) = happyGoto action_55
+action_186 (67) = happyGoto action_56
+action_186 (68) = happyGoto action_201
+action_186 _ = happyReduce_71
+
+action_187 (76) = happyShift action_189
+action_187 (77) = happyShift action_190
+action_187 (85) = happyShift action_191
+action_187 _ = happyReduce_123
+
+action_188 (74) = happyShift action_40
+action_188 (86) = happyShift action_41
+action_188 (89) = happyShift action_42
+action_188 (94) = happyShift action_43
+action_188 (96) = happyShift action_44
+action_188 (99) = happyShift action_45
+action_188 (100) = happyShift action_46
+action_188 (109) = happyShift action_47
+action_188 (111) = happyShift action_48
+action_188 (117) = happyShift action_49
+action_188 (39) = happyGoto action_35
+action_188 (70) = happyGoto action_200
+action_188 (72) = happyGoto action_38
+action_188 _ = happyFail
+
+action_189 _ = happyReduce_128
+
+action_190 _ = happyReduce_129
+
+action_191 _ = happyReduce_130
+
+action_192 (113) = happyShift action_199
+action_192 _ = happyFail
+
+action_193 (87) = happyShift action_198
+action_193 _ = happyFail
+
+action_194 (75) = happyShift action_197
+action_194 _ = happyFail
+
+action_195 (74) = happyShift action_40
+action_195 (86) = happyShift action_41
+action_195 (89) = happyShift action_42
+action_195 (94) = happyShift action_43
+action_195 (96) = happyShift action_44
+action_195 (99) = happyShift action_45
+action_195 (100) = happyShift action_46
+action_195 (109) = happyShift action_47
+action_195 (111) = happyShift action_48
+action_195 (117) = happyShift action_49
+action_195 (39) = happyGoto action_35
+action_195 (70) = happyGoto action_196
+action_195 (72) = happyGoto action_38
+action_195 _ = happyFail
+
+action_196 (74) = happyShift action_40
+action_196 (86) = happyShift action_41
+action_196 (89) = happyShift action_42
+action_196 (94) = happyShift action_43
+action_196 (96) = happyShift action_44
+action_196 (99) = happyShift action_45
+action_196 (100) = happyShift action_46
+action_196 (109) = happyShift action_47
+action_196 (111) = happyShift action_48
+action_196 (117) = happyShift action_49
+action_196 (39) = happyGoto action_35
+action_196 (72) = happyGoto action_187
+action_196 _ = happyReduce_126
+
+action_197 _ = happyReduce_140
+
+action_198 _ = happyReduce_133
+
+action_199 _ = happyReduce_134
+
+action_200 (74) = happyShift action_40
+action_200 (86) = happyShift action_41
+action_200 (89) = happyShift action_42
+action_200 (94) = happyShift action_43
+action_200 (96) = happyShift action_44
+action_200 (99) = happyShift action_45
+action_200 (100) = happyShift action_46
+action_200 (109) = happyShift action_47
+action_200 (111) = happyShift action_48
+action_200 (117) = happyShift action_49
+action_200 (39) = happyGoto action_35
+action_200 (72) = happyGoto action_187
+action_200 _ = happyReduce_125
+
+action_201 _ = happyReduce_120
+
+action_202 _ = happyReduce_112
+
+action_203 _ = happyReduce_111
+
+action_204 _ = happyReduce_115
+
+action_205 _ = happyReduce_102
+
+action_206 _ = happyReduce_101
+
+action_207 (87) = happyShift action_240
+action_207 _ = happyFail
+
+action_208 _ = happyReduce_91
+
+action_209 _ = happyReduce_85
+
+action_210 _ = happyReduce_88
+
+action_211 _ = happyReduce_82
+
+action_212 (87) = happyShift action_239
+action_212 _ = happyFail
+
+action_213 _ = happyReduce_77
+
+action_214 _ = happyReduce_73
+
+action_215 (82) = happyShift action_238
+action_215 _ = happyFail
+
+action_216 _ = happyReduce_63
+
+action_217 _ = happyReduce_55
+
+action_218 (84) = happyShift action_237
+action_218 (114) = happyShift action_34
+action_218 (36) = happyGoto action_85
+action_218 (58) = happyGoto action_176
+action_218 _ = happyFail
+
+action_219 (115) = happyShift action_68
+action_219 (37) = happyGoto action_236
+action_219 _ = happyFail
+
+action_220 (86) = happyShift action_106
+action_220 (114) = happyShift action_34
+action_220 (36) = happyGoto action_104
+action_220 (50) = happyGoto action_235
+action_220 _ = happyFail
+
+action_221 _ = happyReduce_67
+
+action_222 (74) = happyShift action_40
+action_222 (86) = happyShift action_41
+action_222 (89) = happyShift action_42
+action_222 (94) = happyShift action_43
+action_222 (96) = happyShift action_44
+action_222 (99) = happyShift action_45
+action_222 (100) = happyShift action_46
+action_222 (109) = happyShift action_47
+action_222 (111) = happyShift action_48
+action_222 (117) = happyShift action_49
+action_222 (39) = happyGoto action_35
+action_222 (70) = happyGoto action_36
+action_222 (71) = happyGoto action_37
+action_222 (72) = happyGoto action_38
+action_222 (73) = happyGoto action_234
+action_222 _ = happyFail
+
+action_223 (49) = happyGoto action_55
+action_223 (67) = happyGoto action_56
+action_223 (68) = happyGoto action_233
+action_223 _ = happyReduce_71
+
+action_224 (115) = happyShift action_68
+action_224 (37) = happyGoto action_232
+action_224 _ = happyFail
+
+action_225 (115) = happyShift action_68
+action_225 (37) = happyGoto action_231
+action_225 _ = happyFail
+
+action_226 _ = happyReduce_57
+
+action_227 _ = happyReduce_51
+
+action_228 _ = happyReduce_47
+
+action_229 _ = happyReduce_44
+
+action_230 _ = happyReduce_40
+
+action_231 _ = happyReduce_61
+
+action_232 _ = happyReduce_60
+
+action_233 _ = happyReduce_64
+
+action_234 _ = happyReduce_58
+
+action_235 (82) = happyShift action_246
+action_235 _ = happyFail
+
+action_236 (104) = happyShift action_82
+action_236 (106) = happyShift action_83
+action_236 (60) = happyGoto action_245
+action_236 _ = happyReduce_97
+
+action_237 (74) = happyShift action_66
+action_237 (86) = happyShift action_67
+action_237 (114) = happyShift action_34
+action_237 (115) = happyShift action_68
+action_237 (116) = happyShift action_69
+action_237 (117) = happyShift action_49
+action_237 (118) = happyShift action_70
+action_237 (36) = happyGoto action_71
+action_237 (37) = happyGoto action_60
+action_237 (38) = happyGoto action_61
+action_237 (39) = happyGoto action_62
+action_237 (40) = happyGoto action_63
+action_237 (62) = happyGoto action_244
+action_237 (63) = happyGoto action_73
+action_237 (64) = happyGoto action_74
+action_237 _ = happyFail
+
+action_238 (49) = happyGoto action_243
+action_238 _ = happyReduce_71
+
+action_239 (75) = happyShift action_242
+action_239 _ = happyFail
+
+action_240 (78) = happyShift action_241
+action_240 _ = happyFail
+
+action_241 (86) = happyShift action_249
+action_241 _ = happyFail
+
+action_242 _ = happyReduce_83
+
+action_243 (86) = happyShift action_106
+action_243 (114) = happyShift action_34
+action_243 (115) = happyShift action_68
+action_243 (36) = happyGoto action_104
+action_243 (37) = happyGoto action_108
+action_243 (48) = happyGoto action_164
+action_243 (50) = happyGoto action_110
+action_243 _ = happyReduce_53
+
+action_244 _ = happyReduce_65
+
+action_245 (101) = happyShift action_54
+action_245 (69) = happyGoto action_248
+action_245 _ = happyReduce_122
+
+action_246 (49) = happyGoto action_247
+action_246 _ = happyReduce_71
+
+action_247 (86) = happyShift action_106
+action_247 (114) = happyShift action_34
+action_247 (115) = happyShift action_68
+action_247 (36) = happyGoto action_104
+action_247 (37) = happyGoto action_108
+action_247 (48) = happyGoto action_164
+action_247 (50) = happyGoto action_110
+action_247 _ = happyReduce_56
+
+action_248 _ = happyReduce_62
+
+action_249 (116) = happyShift action_69
+action_249 (38) = happyGoto action_93
+action_249 (55) = happyGoto action_250
+action_249 _ = happyReduce_86
+
+action_250 (87) = happyShift action_251
+action_250 _ = happyFail
+
+action_251 (75) = happyShift action_252
+action_251 _ = happyFail
+
+action_252 _ = happyReduce_84
+
+happyReduce_33 = happySpecReduce_1  36 happyReduction_33
+happyReduction_33 (HappyTerminal (PT _ (TV happy_var_1)))
+	 =  HappyAbsSyn36
+		 (Ident happy_var_1
+	)
+happyReduction_33 _  = notHappyAtAll 
+
+happyReduce_34 = happySpecReduce_1  37 happyReduction_34
+happyReduction_34 (HappyTerminal (PT _ (TL happy_var_1)))
+	 =  HappyAbsSyn37
+		 (happy_var_1
+	)
+happyReduction_34 _  = notHappyAtAll 
+
+happyReduce_35 = happySpecReduce_1  38 happyReduction_35
+happyReduction_35 (HappyTerminal (PT _ (TI happy_var_1)))
+	 =  HappyAbsSyn38
+		 ((read ( happy_var_1)) :: Integer
+	)
+happyReduction_35 _  = notHappyAtAll 
+
+happyReduce_36 = happySpecReduce_1  39 happyReduction_36
+happyReduction_36 (HappyTerminal (PT _ (TC happy_var_1)))
+	 =  HappyAbsSyn39
+		 ((read ( happy_var_1)) :: Char
+	)
+happyReduction_36 _  = notHappyAtAll 
+
+happyReduce_37 = happySpecReduce_1  40 happyReduction_37
+happyReduction_37 (HappyTerminal (PT _ (TD happy_var_1)))
+	 =  HappyAbsSyn40
+		 ((read ( happy_var_1)) :: Double
+	)
+happyReduction_37 _  = notHappyAtAll 
+
+happyReduce_38 = happySpecReduce_1  41 happyReduction_38
+happyReduction_38 (HappyAbsSyn43  happy_var_1)
+	 =  HappyAbsSyn41
+		 (AbsBNF.LGr happy_var_1
+	)
+happyReduction_38 _  = notHappyAtAll 
+
+happyReduce_39 = happySpecReduce_1  42 happyReduction_39
+happyReduction_39 (HappyAbsSyn47  happy_var_1)
+	 =  HappyAbsSyn42
+		 (AbsBNF.DefAll happy_var_1
+	)
+happyReduction_39 _  = notHappyAtAll 
+
+happyReduce_40 = happySpecReduce_3  42 happyReduction_40
+happyReduction_40 (HappyAbsSyn47  happy_var_3)
+	_
+	(HappyAbsSyn44  happy_var_1)
+	 =  HappyAbsSyn42
+		 (AbsBNF.DefSome happy_var_1 happy_var_3
+	)
+happyReduction_40 _ _ _  = notHappyAtAll 
+
+happyReduce_41 = happySpecReduce_2  42 happyReduction_41
+happyReduction_41 (HappyAbsSyn44  happy_var_2)
+	_
+	 =  HappyAbsSyn42
+		 (AbsBNF.LDefView happy_var_2
+	)
+happyReduction_41 _ _  = notHappyAtAll 
+
+happyReduce_42 = happySpecReduce_0  43 happyReduction_42
+happyReduction_42  =  HappyAbsSyn43
+		 ([]
+	)
+
+happyReduce_43 = happySpecReduce_1  43 happyReduction_43
+happyReduction_43 (HappyAbsSyn42  happy_var_1)
+	 =  HappyAbsSyn43
+		 ((:[]) happy_var_1
+	)
+happyReduction_43 _  = notHappyAtAll 
+
+happyReduce_44 = happySpecReduce_3  43 happyReduction_44
+happyReduction_44 (HappyAbsSyn43  happy_var_3)
+	_
+	(HappyAbsSyn42  happy_var_1)
+	 =  HappyAbsSyn43
+		 ((:) happy_var_1 happy_var_3
+	)
+happyReduction_44 _ _ _  = notHappyAtAll 
+
+happyReduce_45 = happySpecReduce_2  43 happyReduction_45
+happyReduction_45 (HappyAbsSyn43  happy_var_2)
+	_
+	 =  HappyAbsSyn43
+		 (happy_var_2
+	)
+happyReduction_45 _ _  = notHappyAtAll 
+
+happyReduce_46 = happySpecReduce_1  44 happyReduction_46
+happyReduction_46 (HappyAbsSyn36  happy_var_1)
+	 =  HappyAbsSyn44
+		 ((:[]) happy_var_1
+	)
+happyReduction_46 _  = notHappyAtAll 
+
+happyReduce_47 = happySpecReduce_3  44 happyReduction_47
+happyReduction_47 (HappyAbsSyn44  happy_var_3)
+	_
+	(HappyAbsSyn36  happy_var_1)
+	 =  HappyAbsSyn44
+		 ((:) happy_var_1 happy_var_3
+	)
+happyReduction_47 _ _ _  = notHappyAtAll 
+
+happyReduce_48 = happySpecReduce_1  45 happyReduction_48
+happyReduction_48 (HappyAbsSyn46  happy_var_1)
+	 =  HappyAbsSyn45
+		 (AbsBNF.Grammar happy_var_1
+	)
+happyReduction_48 _  = notHappyAtAll 
+
+happyReduce_49 = happySpecReduce_0  46 happyReduction_49
+happyReduction_49  =  HappyAbsSyn46
+		 ([]
+	)
+
+happyReduce_50 = happySpecReduce_1  46 happyReduction_50
+happyReduction_50 (HappyAbsSyn47  happy_var_1)
+	 =  HappyAbsSyn46
+		 ((:[]) happy_var_1
+	)
+happyReduction_50 _  = notHappyAtAll 
+
+happyReduce_51 = happySpecReduce_3  46 happyReduction_51
+happyReduction_51 (HappyAbsSyn46  happy_var_3)
+	_
+	(HappyAbsSyn47  happy_var_1)
+	 =  HappyAbsSyn46
+		 ((:) happy_var_1 happy_var_3
+	)
+happyReduction_51 _ _ _  = notHappyAtAll 
+
+happyReduce_52 = happySpecReduce_2  46 happyReduction_52
+happyReduction_52 (HappyAbsSyn46  happy_var_2)
+	_
+	 =  HappyAbsSyn46
+		 (happy_var_2
+	)
+happyReduction_52 _ _  = notHappyAtAll 
+
+happyReduce_53 = happyReduce 5 47 happyReduction_53
+happyReduction_53 ((HappyAbsSyn49  happy_var_5) `HappyStk`
+	_ `HappyStk`
+	(HappyAbsSyn50  happy_var_3) `HappyStk`
+	_ `HappyStk`
+	(HappyAbsSyn51  happy_var_1) `HappyStk`
+	happyRest)
+	 = HappyAbsSyn47
+		 (AbsBNF.Rule happy_var_1 happy_var_3 (reverse happy_var_5)
+	) `HappyStk` happyRest
+
+happyReduce_54 = happySpecReduce_2  47 happyReduction_54
+happyReduction_54 (HappyAbsSyn37  happy_var_2)
+	_
+	 =  HappyAbsSyn47
+		 (AbsBNF.Comment happy_var_2
+	)
+happyReduction_54 _ _  = notHappyAtAll 
+
+happyReduce_55 = happySpecReduce_3  47 happyReduction_55
+happyReduction_55 (HappyAbsSyn37  happy_var_3)
+	(HappyAbsSyn37  happy_var_2)
+	_
+	 =  HappyAbsSyn47
+		 (AbsBNF.Comments happy_var_2 happy_var_3
+	)
+happyReduction_55 _ _ _  = notHappyAtAll 
+
+happyReduce_56 = happyReduce 6 47 happyReduction_56
+happyReduction_56 ((HappyAbsSyn49  happy_var_6) `HappyStk`
+	_ `HappyStk`
+	(HappyAbsSyn50  happy_var_4) `HappyStk`
+	_ `HappyStk`
+	(HappyAbsSyn51  happy_var_2) `HappyStk`
+	_ `HappyStk`
+	happyRest)
+	 = HappyAbsSyn47
+		 (AbsBNF.Internal happy_var_2 happy_var_4 (reverse happy_var_6)
+	) `HappyStk` happyRest
+
+happyReduce_57 = happySpecReduce_3  47 happyReduction_57
+happyReduction_57 (HappyAbsSyn70  happy_var_3)
+	(HappyAbsSyn36  happy_var_2)
+	_
+	 =  HappyAbsSyn47
+		 (AbsBNF.Token happy_var_2 happy_var_3
+	)
+happyReduction_57 _ _ _  = notHappyAtAll 
+
+happyReduce_58 = happyReduce 4 47 happyReduction_58
+happyReduction_58 ((HappyAbsSyn70  happy_var_4) `HappyStk`
+	(HappyAbsSyn36  happy_var_3) `HappyStk`
+	_ `HappyStk`
+	_ `HappyStk`
+	happyRest)
+	 = HappyAbsSyn47
+		 (AbsBNF.PosToken happy_var_3 happy_var_4
+	) `HappyStk` happyRest
+
+happyReduce_59 = happySpecReduce_2  47 happyReduction_59
+happyReduction_59 (HappyAbsSyn44  happy_var_2)
+	_
+	 =  HappyAbsSyn47
+		 (AbsBNF.Entryp happy_var_2
+	)
+happyReduction_59 _ _  = notHappyAtAll 
+
+happyReduce_60 = happyReduce 4 47 happyReduction_60
+happyReduction_60 ((HappyAbsSyn37  happy_var_4) `HappyStk`
+	(HappyAbsSyn50  happy_var_3) `HappyStk`
+	(HappyAbsSyn69  happy_var_2) `HappyStk`
+	_ `HappyStk`
+	happyRest)
+	 = HappyAbsSyn47
+		 (AbsBNF.Separator happy_var_2 happy_var_3 happy_var_4
+	) `HappyStk` happyRest
+
+happyReduce_61 = happyReduce 4 47 happyReduction_61
+happyReduction_61 ((HappyAbsSyn37  happy_var_4) `HappyStk`
+	(HappyAbsSyn50  happy_var_3) `HappyStk`
+	(HappyAbsSyn69  happy_var_2) `HappyStk`
+	_ `HappyStk`
+	happyRest)
+	 = HappyAbsSyn47
+		 (AbsBNF.Terminator happy_var_2 happy_var_3 happy_var_4
+	) `HappyStk` happyRest
+
+happyReduce_62 = happyReduce 6 47 happyReduction_62
+happyReduction_62 ((HappyAbsSyn69  happy_var_6) `HappyStk`
+	(HappyAbsSyn60  happy_var_5) `HappyStk`
+	(HappyAbsSyn37  happy_var_4) `HappyStk`
+	(HappyAbsSyn37  happy_var_3) `HappyStk`
+	(HappyAbsSyn50  happy_var_2) `HappyStk`
+	_ `HappyStk`
+	happyRest)
+	 = HappyAbsSyn47
+		 (AbsBNF.Delimiters happy_var_2 happy_var_3 happy_var_4 happy_var_5 happy_var_6
+	) `HappyStk` happyRest
+
+happyReduce_63 = happySpecReduce_3  47 happyReduction_63
+happyReduction_63 (HappyAbsSyn38  happy_var_3)
+	(HappyAbsSyn36  happy_var_2)
+	_
+	 =  HappyAbsSyn47
+		 (AbsBNF.Coercions happy_var_2 happy_var_3
+	)
+happyReduction_63 _ _ _  = notHappyAtAll 
+
+happyReduce_64 = happyReduce 4 47 happyReduction_64
+happyReduction_64 ((HappyAbsSyn68  happy_var_4) `HappyStk`
+	_ `HappyStk`
+	(HappyAbsSyn36  happy_var_2) `HappyStk`
+	_ `HappyStk`
+	happyRest)
+	 = HappyAbsSyn47
+		 (AbsBNF.Rules happy_var_2 happy_var_4
+	) `HappyStk` happyRest
+
+happyReduce_65 = happyReduce 5 47 happyReduction_65
+happyReduction_65 ((HappyAbsSyn62  happy_var_5) `HappyStk`
+	_ `HappyStk`
+	(HappyAbsSyn59  happy_var_3) `HappyStk`
+	(HappyAbsSyn36  happy_var_2) `HappyStk`
+	_ `HappyStk`
+	happyRest)
+	 = HappyAbsSyn47
+		 (AbsBNF.Function happy_var_2 (reverse happy_var_3) happy_var_5
+	) `HappyStk` happyRest
+
+happyReduce_66 = happySpecReduce_2  47 happyReduction_66
+happyReduction_66 (HappyAbsSyn61  happy_var_2)
+	_
+	 =  HappyAbsSyn47
+		 (AbsBNF.Layout happy_var_2
+	)
+happyReduction_66 _ _  = notHappyAtAll 
+
+happyReduce_67 = happySpecReduce_3  47 happyReduction_67
+happyReduction_67 (HappyAbsSyn61  happy_var_3)
+	_
+	_
+	 =  HappyAbsSyn47
+		 (AbsBNF.LayoutStop happy_var_3
+	)
+happyReduction_67 _ _ _  = notHappyAtAll 
+
+happyReduce_68 = happySpecReduce_2  47 happyReduction_68
+happyReduction_68 _
+	_
+	 =  HappyAbsSyn47
+		 (AbsBNF.LayoutTop
+	)
+
+happyReduce_69 = happySpecReduce_1  48 happyReduction_69
+happyReduction_69 (HappyAbsSyn37  happy_var_1)
+	 =  HappyAbsSyn48
+		 (AbsBNF.Terminal happy_var_1
+	)
+happyReduction_69 _  = notHappyAtAll 
+
+happyReduce_70 = happySpecReduce_1  48 happyReduction_70
+happyReduction_70 (HappyAbsSyn50  happy_var_1)
+	 =  HappyAbsSyn48
+		 (AbsBNF.NTerminal happy_var_1
+	)
+happyReduction_70 _  = notHappyAtAll 
+
+happyReduce_71 = happySpecReduce_0  49 happyReduction_71
+happyReduction_71  =  HappyAbsSyn49
+		 ([]
+	)
+
+happyReduce_72 = happySpecReduce_2  49 happyReduction_72
+happyReduction_72 (HappyAbsSyn48  happy_var_2)
+	(HappyAbsSyn49  happy_var_1)
+	 =  HappyAbsSyn49
+		 (flip (:) happy_var_1 happy_var_2
+	)
+happyReduction_72 _ _  = notHappyAtAll 
+
+happyReduce_73 = happySpecReduce_3  50 happyReduction_73
+happyReduction_73 _
+	(HappyAbsSyn50  happy_var_2)
+	_
+	 =  HappyAbsSyn50
+		 (AbsBNF.ListCat happy_var_2
+	)
+happyReduction_73 _ _ _  = notHappyAtAll 
+
+happyReduce_74 = happySpecReduce_1  50 happyReduction_74
+happyReduction_74 (HappyAbsSyn36  happy_var_1)
+	 =  HappyAbsSyn50
+		 (AbsBNF.IdCat happy_var_1
+	)
+happyReduction_74 _  = notHappyAtAll 
+
+happyReduce_75 = happySpecReduce_1  51 happyReduction_75
+happyReduction_75 (HappyAbsSyn52  happy_var_1)
+	 =  HappyAbsSyn51
+		 (AbsBNF.LabNoP happy_var_1
+	)
+happyReduction_75 _  = notHappyAtAll 
+
+happyReduce_76 = happySpecReduce_2  51 happyReduction_76
+happyReduction_76 (HappyAbsSyn57  happy_var_2)
+	(HappyAbsSyn52  happy_var_1)
+	 =  HappyAbsSyn51
+		 (AbsBNF.LabP happy_var_1 happy_var_2
+	)
+happyReduction_76 _ _  = notHappyAtAll 
+
+happyReduce_77 = happySpecReduce_3  51 happyReduction_77
+happyReduction_77 (HappyAbsSyn57  happy_var_3)
+	(HappyAbsSyn52  happy_var_2)
+	(HappyAbsSyn52  happy_var_1)
+	 =  HappyAbsSyn51
+		 (AbsBNF.LabPF happy_var_1 happy_var_2 happy_var_3
+	)
+happyReduction_77 _ _ _  = notHappyAtAll 
+
+happyReduce_78 = happySpecReduce_2  51 happyReduction_78
+happyReduction_78 (HappyAbsSyn52  happy_var_2)
+	(HappyAbsSyn52  happy_var_1)
+	 =  HappyAbsSyn51
+		 (AbsBNF.LabF happy_var_1 happy_var_2
+	)
+happyReduction_78 _ _  = notHappyAtAll 
+
+happyReduce_79 = happySpecReduce_1  52 happyReduction_79
+happyReduction_79 (HappyAbsSyn36  happy_var_1)
+	 =  HappyAbsSyn52
+		 (AbsBNF.Id happy_var_1
+	)
+happyReduction_79 _  = notHappyAtAll 
+
+happyReduce_80 = happySpecReduce_1  52 happyReduction_80
+happyReduction_80 _
+	 =  HappyAbsSyn52
+		 (AbsBNF.Wild
+	)
+
+happyReduce_81 = happySpecReduce_2  52 happyReduction_81
+happyReduction_81 _
+	_
+	 =  HappyAbsSyn52
+		 (AbsBNF.ListE
+	)
+
+happyReduce_82 = happySpecReduce_3  52 happyReduction_82
+happyReduction_82 _
+	_
+	_
+	 =  HappyAbsSyn52
+		 (AbsBNF.ListCons
+	)
+
+happyReduce_83 = happyReduce 5 52 happyReduction_83
+happyReduction_83 (_ `HappyStk`
+	_ `HappyStk`
+	_ `HappyStk`
+	_ `HappyStk`
+	_ `HappyStk`
+	happyRest)
+	 = HappyAbsSyn52
+		 (AbsBNF.ListOne
+	) `HappyStk` happyRest
+
+happyReduce_84 = happyReduce 9 53 happyReduction_84
+happyReduction_84 (_ `HappyStk`
+	_ `HappyStk`
+	(HappyAbsSyn55  happy_var_7) `HappyStk`
+	_ `HappyStk`
+	_ `HappyStk`
+	_ `HappyStk`
+	(HappyAbsSyn56  happy_var_3) `HappyStk`
+	_ `HappyStk`
+	_ `HappyStk`
+	happyRest)
+	 = HappyAbsSyn53
+		 (AbsBNF.ProfIt happy_var_3 happy_var_7
+	) `HappyStk` happyRest
+
+happyReduce_85 = happySpecReduce_3  54 happyReduction_85
+happyReduction_85 _
+	(HappyAbsSyn55  happy_var_2)
+	_
+	 =  HappyAbsSyn54
+		 (AbsBNF.Ints happy_var_2
+	)
+happyReduction_85 _ _ _  = notHappyAtAll 
+
+happyReduce_86 = happySpecReduce_0  55 happyReduction_86
+happyReduction_86  =  HappyAbsSyn55
+		 ([]
+	)
+
+happyReduce_87 = happySpecReduce_1  55 happyReduction_87
+happyReduction_87 (HappyAbsSyn38  happy_var_1)
+	 =  HappyAbsSyn55
+		 ((:[]) happy_var_1
+	)
+happyReduction_87 _  = notHappyAtAll 
+
+happyReduce_88 = happySpecReduce_3  55 happyReduction_88
+happyReduction_88 (HappyAbsSyn55  happy_var_3)
+	_
+	(HappyAbsSyn38  happy_var_1)
+	 =  HappyAbsSyn55
+		 ((:) happy_var_1 happy_var_3
+	)
+happyReduction_88 _ _ _  = notHappyAtAll 
+
+happyReduce_89 = happySpecReduce_0  56 happyReduction_89
+happyReduction_89  =  HappyAbsSyn56
+		 ([]
+	)
+
+happyReduce_90 = happySpecReduce_1  56 happyReduction_90
+happyReduction_90 (HappyAbsSyn54  happy_var_1)
+	 =  HappyAbsSyn56
+		 ((:[]) happy_var_1
+	)
+happyReduction_90 _  = notHappyAtAll 
+
+happyReduce_91 = happySpecReduce_3  56 happyReduction_91
+happyReduction_91 (HappyAbsSyn56  happy_var_3)
+	_
+	(HappyAbsSyn54  happy_var_1)
+	 =  HappyAbsSyn56
+		 ((:) happy_var_1 happy_var_3
+	)
+happyReduction_91 _ _ _  = notHappyAtAll 
+
+happyReduce_92 = happySpecReduce_1  57 happyReduction_92
+happyReduction_92 (HappyAbsSyn53  happy_var_1)
+	 =  HappyAbsSyn57
+		 ((:[]) happy_var_1
+	)
+happyReduction_92 _  = notHappyAtAll 
+
+happyReduce_93 = happySpecReduce_2  57 happyReduction_93
+happyReduction_93 (HappyAbsSyn57  happy_var_2)
+	(HappyAbsSyn53  happy_var_1)
+	 =  HappyAbsSyn57
+		 ((:) happy_var_1 happy_var_2
+	)
+happyReduction_93 _ _  = notHappyAtAll 
+
+happyReduce_94 = happySpecReduce_1  58 happyReduction_94
+happyReduction_94 (HappyAbsSyn36  happy_var_1)
+	 =  HappyAbsSyn58
+		 (AbsBNF.Arg happy_var_1
+	)
+happyReduction_94 _  = notHappyAtAll 
+
+happyReduce_95 = happySpecReduce_0  59 happyReduction_95
+happyReduction_95  =  HappyAbsSyn59
+		 ([]
+	)
+
+happyReduce_96 = happySpecReduce_2  59 happyReduction_96
+happyReduction_96 (HappyAbsSyn58  happy_var_2)
+	(HappyAbsSyn59  happy_var_1)
+	 =  HappyAbsSyn59
+		 (flip (:) happy_var_1 happy_var_2
+	)
+happyReduction_96 _ _  = notHappyAtAll 
+
+happyReduce_97 = happySpecReduce_0  60 happyReduction_97
+happyReduction_97  =  HappyAbsSyn60
+		 (AbsBNF.SepNone
+	)
+
+happyReduce_98 = happySpecReduce_2  60 happyReduction_98
+happyReduction_98 (HappyAbsSyn37  happy_var_2)
+	_
+	 =  HappyAbsSyn60
+		 (AbsBNF.SepTerm happy_var_2
+	)
+happyReduction_98 _ _  = notHappyAtAll 
+
+happyReduce_99 = happySpecReduce_2  60 happyReduction_99
+happyReduction_99 (HappyAbsSyn37  happy_var_2)
+	_
+	 =  HappyAbsSyn60
+		 (AbsBNF.SepSepar happy_var_2
+	)
+happyReduction_99 _ _  = notHappyAtAll 
+
+happyReduce_100 = happySpecReduce_1  61 happyReduction_100
+happyReduction_100 (HappyAbsSyn37  happy_var_1)
+	 =  HappyAbsSyn61
+		 ((:[]) happy_var_1
+	)
+happyReduction_100 _  = notHappyAtAll 
+
+happyReduce_101 = happySpecReduce_3  61 happyReduction_101
+happyReduction_101 (HappyAbsSyn61  happy_var_3)
+	_
+	(HappyAbsSyn37  happy_var_1)
+	 =  HappyAbsSyn61
+		 ((:) happy_var_1 happy_var_3
+	)
+happyReduction_101 _ _ _  = notHappyAtAll 
+
+happyReduce_102 = happySpecReduce_3  62 happyReduction_102
+happyReduction_102 (HappyAbsSyn62  happy_var_3)
+	_
+	(HappyAbsSyn62  happy_var_1)
+	 =  HappyAbsSyn62
+		 (AbsBNF.Cons happy_var_1 happy_var_3
+	)
+happyReduction_102 _ _ _  = notHappyAtAll 
+
+happyReduce_103 = happySpecReduce_1  62 happyReduction_103
+happyReduction_103 (HappyAbsSyn62  happy_var_1)
+	 =  HappyAbsSyn62
+		 (happy_var_1
+	)
+happyReduction_103 _  = notHappyAtAll 
+
+happyReduce_104 = happySpecReduce_2  63 happyReduction_104
+happyReduction_104 (HappyAbsSyn65  happy_var_2)
+	(HappyAbsSyn36  happy_var_1)
+	 =  HappyAbsSyn62
+		 (AbsBNF.App happy_var_1 happy_var_2
+	)
+happyReduction_104 _ _  = notHappyAtAll 
+
+happyReduce_105 = happySpecReduce_1  63 happyReduction_105
+happyReduction_105 (HappyAbsSyn62  happy_var_1)
+	 =  HappyAbsSyn62
+		 (happy_var_1
+	)
+happyReduction_105 _  = notHappyAtAll 
+
+happyReduce_106 = happySpecReduce_1  64 happyReduction_106
+happyReduction_106 (HappyAbsSyn36  happy_var_1)
+	 =  HappyAbsSyn62
+		 (AbsBNF.Var happy_var_1
+	)
+happyReduction_106 _  = notHappyAtAll 
+
+happyReduce_107 = happySpecReduce_1  64 happyReduction_107
+happyReduction_107 (HappyAbsSyn38  happy_var_1)
+	 =  HappyAbsSyn62
+		 (AbsBNF.LitInt happy_var_1
+	)
+happyReduction_107 _  = notHappyAtAll 
+
+happyReduce_108 = happySpecReduce_1  64 happyReduction_108
+happyReduction_108 (HappyAbsSyn39  happy_var_1)
+	 =  HappyAbsSyn62
+		 (AbsBNF.LitChar happy_var_1
+	)
+happyReduction_108 _  = notHappyAtAll 
+
+happyReduce_109 = happySpecReduce_1  64 happyReduction_109
+happyReduction_109 (HappyAbsSyn37  happy_var_1)
+	 =  HappyAbsSyn62
+		 (AbsBNF.LitString happy_var_1
+	)
+happyReduction_109 _  = notHappyAtAll 
+
+happyReduce_110 = happySpecReduce_1  64 happyReduction_110
+happyReduction_110 (HappyAbsSyn40  happy_var_1)
+	 =  HappyAbsSyn62
+		 (AbsBNF.LitDouble happy_var_1
+	)
+happyReduction_110 _  = notHappyAtAll 
+
+happyReduce_111 = happySpecReduce_3  64 happyReduction_111
+happyReduction_111 _
+	(HappyAbsSyn65  happy_var_2)
+	_
+	 =  HappyAbsSyn62
+		 (AbsBNF.List happy_var_2
+	)
+happyReduction_111 _ _ _  = notHappyAtAll 
+
+happyReduce_112 = happySpecReduce_3  64 happyReduction_112
+happyReduction_112 _
+	(HappyAbsSyn62  happy_var_2)
+	_
+	 =  HappyAbsSyn62
+		 (happy_var_2
+	)
+happyReduction_112 _ _ _  = notHappyAtAll 
+
+happyReduce_113 = happySpecReduce_0  65 happyReduction_113
+happyReduction_113  =  HappyAbsSyn65
+		 ([]
+	)
+
+happyReduce_114 = happySpecReduce_1  65 happyReduction_114
+happyReduction_114 (HappyAbsSyn62  happy_var_1)
+	 =  HappyAbsSyn65
+		 ((:[]) happy_var_1
+	)
+happyReduction_114 _  = notHappyAtAll 
+
+happyReduce_115 = happySpecReduce_3  65 happyReduction_115
+happyReduction_115 (HappyAbsSyn65  happy_var_3)
+	_
+	(HappyAbsSyn62  happy_var_1)
+	 =  HappyAbsSyn65
+		 ((:) happy_var_1 happy_var_3
+	)
+happyReduction_115 _ _ _  = notHappyAtAll 
+
+happyReduce_116 = happySpecReduce_1  66 happyReduction_116
+happyReduction_116 (HappyAbsSyn62  happy_var_1)
+	 =  HappyAbsSyn65
+		 ((:[]) happy_var_1
+	)
+happyReduction_116 _  = notHappyAtAll 
+
+happyReduce_117 = happySpecReduce_2  66 happyReduction_117
+happyReduction_117 (HappyAbsSyn65  happy_var_2)
+	(HappyAbsSyn62  happy_var_1)
+	 =  HappyAbsSyn65
+		 ((:) happy_var_1 happy_var_2
+	)
+happyReduction_117 _ _  = notHappyAtAll 
+
+happyReduce_118 = happySpecReduce_1  67 happyReduction_118
+happyReduction_118 (HappyAbsSyn49  happy_var_1)
+	 =  HappyAbsSyn67
+		 (AbsBNF.RHS (reverse happy_var_1)
+	)
+happyReduction_118 _  = notHappyAtAll 
+
+happyReduce_119 = happySpecReduce_1  68 happyReduction_119
+happyReduction_119 (HappyAbsSyn67  happy_var_1)
+	 =  HappyAbsSyn68
+		 ((:[]) happy_var_1
+	)
+happyReduction_119 _  = notHappyAtAll 
+
+happyReduce_120 = happySpecReduce_3  68 happyReduction_120
+happyReduction_120 (HappyAbsSyn68  happy_var_3)
+	_
+	(HappyAbsSyn67  happy_var_1)
+	 =  HappyAbsSyn68
+		 ((:) happy_var_1 happy_var_3
+	)
+happyReduction_120 _ _ _  = notHappyAtAll 
+
+happyReduce_121 = happySpecReduce_1  69 happyReduction_121
+happyReduction_121 _
+	 =  HappyAbsSyn69
+		 (AbsBNF.MNonempty
+	)
+
+happyReduce_122 = happySpecReduce_0  69 happyReduction_122
+happyReduction_122  =  HappyAbsSyn69
+		 (AbsBNF.MEmpty
+	)
+
+happyReduce_123 = happySpecReduce_2  70 happyReduction_123
+happyReduction_123 (HappyAbsSyn70  happy_var_2)
+	(HappyAbsSyn70  happy_var_1)
+	 =  HappyAbsSyn70
+		 (AbsBNF.RSeq happy_var_1 happy_var_2
+	)
+happyReduction_123 _ _  = notHappyAtAll 
+
+happyReduce_124 = happySpecReduce_1  70 happyReduction_124
+happyReduction_124 (HappyAbsSyn70  happy_var_1)
+	 =  HappyAbsSyn70
+		 (happy_var_1
+	)
+happyReduction_124 _  = notHappyAtAll 
+
+happyReduce_125 = happySpecReduce_3  71 happyReduction_125
+happyReduction_125 (HappyAbsSyn70  happy_var_3)
+	_
+	(HappyAbsSyn70  happy_var_1)
+	 =  HappyAbsSyn70
+		 (AbsBNF.RAlt happy_var_1 happy_var_3
+	)
+happyReduction_125 _ _ _  = notHappyAtAll 
+
+happyReduce_126 = happySpecReduce_3  71 happyReduction_126
+happyReduction_126 (HappyAbsSyn70  happy_var_3)
+	_
+	(HappyAbsSyn70  happy_var_1)
+	 =  HappyAbsSyn70
+		 (AbsBNF.RMinus happy_var_1 happy_var_3
+	)
+happyReduction_126 _ _ _  = notHappyAtAll 
+
+happyReduce_127 = happySpecReduce_1  71 happyReduction_127
+happyReduction_127 (HappyAbsSyn70  happy_var_1)
+	 =  HappyAbsSyn70
+		 (happy_var_1
+	)
+happyReduction_127 _  = notHappyAtAll 
+
+happyReduce_128 = happySpecReduce_2  72 happyReduction_128
+happyReduction_128 _
+	(HappyAbsSyn70  happy_var_1)
+	 =  HappyAbsSyn70
+		 (AbsBNF.RStar happy_var_1
+	)
+happyReduction_128 _ _  = notHappyAtAll 
+
+happyReduce_129 = happySpecReduce_2  72 happyReduction_129
+happyReduction_129 _
+	(HappyAbsSyn70  happy_var_1)
+	 =  HappyAbsSyn70
+		 (AbsBNF.RPlus happy_var_1
+	)
+happyReduction_129 _ _  = notHappyAtAll 
+
+happyReduce_130 = happySpecReduce_2  72 happyReduction_130
+happyReduction_130 _
+	(HappyAbsSyn70  happy_var_1)
+	 =  HappyAbsSyn70
+		 (AbsBNF.ROpt happy_var_1
+	)
+happyReduction_130 _ _  = notHappyAtAll 
+
+happyReduce_131 = happySpecReduce_1  72 happyReduction_131
+happyReduction_131 _
+	 =  HappyAbsSyn70
+		 (AbsBNF.REps
+	)
+
+happyReduce_132 = happySpecReduce_1  72 happyReduction_132
+happyReduction_132 (HappyAbsSyn39  happy_var_1)
+	 =  HappyAbsSyn70
+		 (AbsBNF.RChar happy_var_1
+	)
+happyReduction_132 _  = notHappyAtAll 
+
+happyReduce_133 = happySpecReduce_3  72 happyReduction_133
+happyReduction_133 _
+	(HappyAbsSyn37  happy_var_2)
+	_
+	 =  HappyAbsSyn70
+		 (AbsBNF.RAlts happy_var_2
+	)
+happyReduction_133 _ _ _  = notHappyAtAll 
+
+happyReduce_134 = happySpecReduce_3  72 happyReduction_134
+happyReduction_134 _
+	(HappyAbsSyn37  happy_var_2)
+	_
+	 =  HappyAbsSyn70
+		 (AbsBNF.RSeqs happy_var_2
+	)
+happyReduction_134 _ _ _  = notHappyAtAll 
+
+happyReduce_135 = happySpecReduce_1  72 happyReduction_135
+happyReduction_135 _
+	 =  HappyAbsSyn70
+		 (AbsBNF.RDigit
+	)
+
+happyReduce_136 = happySpecReduce_1  72 happyReduction_136
+happyReduction_136 _
+	 =  HappyAbsSyn70
+		 (AbsBNF.RLetter
+	)
+
+happyReduce_137 = happySpecReduce_1  72 happyReduction_137
+happyReduction_137 _
+	 =  HappyAbsSyn70
+		 (AbsBNF.RUpper
+	)
+
+happyReduce_138 = happySpecReduce_1  72 happyReduction_138
+happyReduction_138 _
+	 =  HappyAbsSyn70
+		 (AbsBNF.RLower
+	)
+
+happyReduce_139 = happySpecReduce_1  72 happyReduction_139
+happyReduction_139 _
+	 =  HappyAbsSyn70
+		 (AbsBNF.RAny
+	)
+
+happyReduce_140 = happySpecReduce_3  72 happyReduction_140
+happyReduction_140 _
+	(HappyAbsSyn70  happy_var_2)
+	_
+	 =  HappyAbsSyn70
+		 (happy_var_2
+	)
+happyReduction_140 _ _ _  = notHappyAtAll 
+
+happyReduce_141 = happySpecReduce_1  73 happyReduction_141
+happyReduction_141 (HappyAbsSyn70  happy_var_1)
+	 =  HappyAbsSyn70
+		 (happy_var_1
+	)
+happyReduction_141 _  = notHappyAtAll 
+
+happyNewToken action sts stk [] =
+	action 119 119 notHappyAtAll (HappyState action) sts stk []
+
+happyNewToken action sts stk (tk:tks) =
+	let cont i = action i i tk (HappyState action) sts stk tks in
+	case tk of {
+	PT _ (TS _ 1) -> cont 74;
+	PT _ (TS _ 2) -> cont 75;
+	PT _ (TS _ 3) -> cont 76;
+	PT _ (TS _ 4) -> cont 77;
+	PT _ (TS _ 5) -> cont 78;
+	PT _ (TS _ 6) -> cont 79;
+	PT _ (TS _ 7) -> cont 80;
+	PT _ (TS _ 8) -> cont 81;
+	PT _ (TS _ 9) -> cont 82;
+	PT _ (TS _ 10) -> cont 83;
+	PT _ (TS _ 11) -> cont 84;
+	PT _ (TS _ 12) -> cont 85;
+	PT _ (TS _ 13) -> cont 86;
+	PT _ (TS _ 14) -> cont 87;
+	PT _ (TS _ 15) -> cont 88;
+	PT _ (TS _ 16) -> cont 89;
+	PT _ (TS _ 17) -> cont 90;
+	PT _ (TS _ 18) -> cont 91;
+	PT _ (TS _ 19) -> cont 92;
+	PT _ (TS _ 20) -> cont 93;
+	PT _ (TS _ 21) -> cont 94;
+	PT _ (TS _ 22) -> cont 95;
+	PT _ (TS _ 23) -> cont 96;
+	PT _ (TS _ 24) -> cont 97;
+	PT _ (TS _ 25) -> cont 98;
+	PT _ (TS _ 26) -> cont 99;
+	PT _ (TS _ 27) -> cont 100;
+	PT _ (TS _ 28) -> cont 101;
+	PT _ (TS _ 29) -> cont 102;
+	PT _ (TS _ 30) -> cont 103;
+	PT _ (TS _ 31) -> cont 104;
+	PT _ (TS _ 32) -> cont 105;
+	PT _ (TS _ 33) -> cont 106;
+	PT _ (TS _ 34) -> cont 107;
+	PT _ (TS _ 35) -> cont 108;
+	PT _ (TS _ 36) -> cont 109;
+	PT _ (TS _ 37) -> cont 110;
+	PT _ (TS _ 38) -> cont 111;
+	PT _ (TS _ 39) -> cont 112;
+	PT _ (TS _ 40) -> cont 113;
+	PT _ (TV happy_dollar_dollar) -> cont 114;
+	PT _ (TL happy_dollar_dollar) -> cont 115;
+	PT _ (TI happy_dollar_dollar) -> cont 116;
+	PT _ (TC happy_dollar_dollar) -> cont 117;
+	PT _ (TD happy_dollar_dollar) -> cont 118;
+	_ -> happyError' (tk:tks)
+	}
+
+happyError_ 119 tk tks = happyError' tks
+happyError_ _ tk tks = happyError' (tk:tks)
+
+happyThen :: () => Err a -> (a -> Err b) -> Err b
+happyThen = (thenM)
+happyReturn :: () => a -> Err a
+happyReturn = (returnM)
+happyThen1 m k tks = (thenM) m (\a -> k a tks)
+happyReturn1 :: () => a -> b -> Err a
+happyReturn1 = \a tks -> (returnM) a
+happyError' :: () => [(Token)] -> Err a
+happyError' = happyError
+
+pLGrammar tks = happySomeParser where
+  happySomeParser = happyThen (happyParse action_0 tks) (\x -> case x of {HappyAbsSyn41 z -> happyReturn z; _other -> notHappyAtAll })
+
+pLDef tks = happySomeParser where
+  happySomeParser = happyThen (happyParse action_1 tks) (\x -> case x of {HappyAbsSyn42 z -> happyReturn z; _other -> notHappyAtAll })
+
+pListLDef tks = happySomeParser where
+  happySomeParser = happyThen (happyParse action_2 tks) (\x -> case x of {HappyAbsSyn43 z -> happyReturn z; _other -> notHappyAtAll })
+
+pListIdent tks = happySomeParser where
+  happySomeParser = happyThen (happyParse action_3 tks) (\x -> case x of {HappyAbsSyn44 z -> happyReturn z; _other -> notHappyAtAll })
+
+pGrammar tks = happySomeParser where
+  happySomeParser = happyThen (happyParse action_4 tks) (\x -> case x of {HappyAbsSyn45 z -> happyReturn z; _other -> notHappyAtAll })
+
+pListDef tks = happySomeParser where
+  happySomeParser = happyThen (happyParse action_5 tks) (\x -> case x of {HappyAbsSyn46 z -> happyReturn z; _other -> notHappyAtAll })
+
+pDef tks = happySomeParser where
+  happySomeParser = happyThen (happyParse action_6 tks) (\x -> case x of {HappyAbsSyn47 z -> happyReturn z; _other -> notHappyAtAll })
+
+pItem tks = happySomeParser where
+  happySomeParser = happyThen (happyParse action_7 tks) (\x -> case x of {HappyAbsSyn48 z -> happyReturn z; _other -> notHappyAtAll })
+
+pListItem tks = happySomeParser where
+  happySomeParser = happyThen (happyParse action_8 tks) (\x -> case x of {HappyAbsSyn49 z -> happyReturn z; _other -> notHappyAtAll })
+
+pCat tks = happySomeParser where
+  happySomeParser = happyThen (happyParse action_9 tks) (\x -> case x of {HappyAbsSyn50 z -> happyReturn z; _other -> notHappyAtAll })
+
+pLabel tks = happySomeParser where
+  happySomeParser = happyThen (happyParse action_10 tks) (\x -> case x of {HappyAbsSyn51 z -> happyReturn z; _other -> notHappyAtAll })
+
+pLabelId tks = happySomeParser where
+  happySomeParser = happyThen (happyParse action_11 tks) (\x -> case x of {HappyAbsSyn52 z -> happyReturn z; _other -> notHappyAtAll })
+
+pProfItem tks = happySomeParser where
+  happySomeParser = happyThen (happyParse action_12 tks) (\x -> case x of {HappyAbsSyn53 z -> happyReturn z; _other -> notHappyAtAll })
+
+pIntList tks = happySomeParser where
+  happySomeParser = happyThen (happyParse action_13 tks) (\x -> case x of {HappyAbsSyn54 z -> happyReturn z; _other -> notHappyAtAll })
+
+pListInteger tks = happySomeParser where
+  happySomeParser = happyThen (happyParse action_14 tks) (\x -> case x of {HappyAbsSyn55 z -> happyReturn z; _other -> notHappyAtAll })
+
+pListIntList tks = happySomeParser where
+  happySomeParser = happyThen (happyParse action_15 tks) (\x -> case x of {HappyAbsSyn56 z -> happyReturn z; _other -> notHappyAtAll })
+
+pListProfItem tks = happySomeParser where
+  happySomeParser = happyThen (happyParse action_16 tks) (\x -> case x of {HappyAbsSyn57 z -> happyReturn z; _other -> notHappyAtAll })
+
+pArg tks = happySomeParser where
+  happySomeParser = happyThen (happyParse action_17 tks) (\x -> case x of {HappyAbsSyn58 z -> happyReturn z; _other -> notHappyAtAll })
+
+pListArg tks = happySomeParser where
+  happySomeParser = happyThen (happyParse action_18 tks) (\x -> case x of {HappyAbsSyn59 z -> happyReturn z; _other -> notHappyAtAll })
+
+pSeparation tks = happySomeParser where
+  happySomeParser = happyThen (happyParse action_19 tks) (\x -> case x of {HappyAbsSyn60 z -> happyReturn z; _other -> notHappyAtAll })
+
+pListString tks = happySomeParser where
+  happySomeParser = happyThen (happyParse action_20 tks) (\x -> case x of {HappyAbsSyn61 z -> happyReturn z; _other -> notHappyAtAll })
+
+pExp tks = happySomeParser where
+  happySomeParser = happyThen (happyParse action_21 tks) (\x -> case x of {HappyAbsSyn62 z -> happyReturn z; _other -> notHappyAtAll })
+
+pExp1 tks = happySomeParser where
+  happySomeParser = happyThen (happyParse action_22 tks) (\x -> case x of {HappyAbsSyn62 z -> happyReturn z; _other -> notHappyAtAll })
+
+pExp2 tks = happySomeParser where
+  happySomeParser = happyThen (happyParse action_23 tks) (\x -> case x of {HappyAbsSyn62 z -> happyReturn z; _other -> notHappyAtAll })
+
+pListExp tks = happySomeParser where
+  happySomeParser = happyThen (happyParse action_24 tks) (\x -> case x of {HappyAbsSyn65 z -> happyReturn z; _other -> notHappyAtAll })
+
+pListExp2 tks = happySomeParser where
+  happySomeParser = happyThen (happyParse action_25 tks) (\x -> case x of {HappyAbsSyn65 z -> happyReturn z; _other -> notHappyAtAll })
+
+pRHS tks = happySomeParser where
+  happySomeParser = happyThen (happyParse action_26 tks) (\x -> case x of {HappyAbsSyn67 z -> happyReturn z; _other -> notHappyAtAll })
+
+pListRHS tks = happySomeParser where
+  happySomeParser = happyThen (happyParse action_27 tks) (\x -> case x of {HappyAbsSyn68 z -> happyReturn z; _other -> notHappyAtAll })
+
+pMinimumSize tks = happySomeParser where
+  happySomeParser = happyThen (happyParse action_28 tks) (\x -> case x of {HappyAbsSyn69 z -> happyReturn z; _other -> notHappyAtAll })
+
+pReg2 tks = happySomeParser where
+  happySomeParser = happyThen (happyParse action_29 tks) (\x -> case x of {HappyAbsSyn70 z -> happyReturn z; _other -> notHappyAtAll })
+
+pReg1 tks = happySomeParser where
+  happySomeParser = happyThen (happyParse action_30 tks) (\x -> case x of {HappyAbsSyn70 z -> happyReturn z; _other -> notHappyAtAll })
+
+pReg3 tks = happySomeParser where
+  happySomeParser = happyThen (happyParse action_31 tks) (\x -> case x of {HappyAbsSyn70 z -> happyReturn z; _other -> notHappyAtAll })
+
+pReg tks = happySomeParser where
+  happySomeParser = happyThen (happyParse action_32 tks) (\x -> case x of {HappyAbsSyn70 z -> happyReturn z; _other -> notHappyAtAll })
+
+happySeq = happyDontSeq
+
+
+returnM :: a -> Err a
+returnM = return
+
+thenM :: Err a -> (a -> Err b) -> Err b
+thenM = (>>=)
+
+happyError :: [Token] -> Err a
+happyError ts =
+  Bad $ "syntax error at " ++ tokenPos ts ++ 
+  case ts of
+    [] -> []
+    [Err _] -> " due to lexer error"
+    t:_ -> " before `" ++ id(prToken t) ++ "'"
+
+myLexer = tokens
+{-# LINE 1 "templates/GenericTemplate.hs" #-}
+{-# LINE 1 "templates/GenericTemplate.hs" #-}
+{-# LINE 1 "<built-in>" #-}
+{-# LINE 1 "<command-line>" #-}
+
+
+
+
+
+
+
+# 1 "/usr/include/stdc-predef.h" 1 3 4
+
+# 17 "/usr/include/stdc-predef.h" 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{-# LINE 7 "<command-line>" #-}
+{-# LINE 1 "templates/GenericTemplate.hs" #-}
+-- Id: GenericTemplate.hs,v 1.26 2005/01/14 14:47:22 simonmar Exp 
+
+{-# LINE 13 "templates/GenericTemplate.hs" #-}
+
+{-# LINE 46 "templates/GenericTemplate.hs" #-}
+
+
+
+
+
+
+
+
+{-# LINE 67 "templates/GenericTemplate.hs" #-}
+
+{-# LINE 77 "templates/GenericTemplate.hs" #-}
+
+{-# LINE 86 "templates/GenericTemplate.hs" #-}
+
+infixr 9 `HappyStk`
+data HappyStk a = HappyStk a (HappyStk a)
+
+-----------------------------------------------------------------------------
+-- starting the parse
+
+happyParse start_state = happyNewToken start_state notHappyAtAll notHappyAtAll
+
+-----------------------------------------------------------------------------
+-- Accepting the parse
+
+-- If the current token is (1), it means we've just accepted a partial
+-- parse (a %partial parser).  We must ignore the saved token on the top of
+-- the stack in this case.
+happyAccept (1) tk st sts (_ `HappyStk` ans `HappyStk` _) =
+        happyReturn1 ans
+happyAccept j tk st sts (HappyStk ans _) = 
+         (happyReturn1 ans)
+
+-----------------------------------------------------------------------------
+-- Arrays only: do the next action
+
+{-# LINE 155 "templates/GenericTemplate.hs" #-}
+
+-----------------------------------------------------------------------------
+-- HappyState data type (not arrays)
+
+
+
+newtype HappyState b c = HappyState
+        (Int ->                    -- token number
+         Int ->                    -- token number (yes, again)
+         b ->                           -- token semantic value
+         HappyState b c ->              -- current state
+         [HappyState b c] ->            -- state stack
+         c)
+
+
+
+-----------------------------------------------------------------------------
+-- Shifting a token
+
+happyShift new_state (1) tk st sts stk@(x `HappyStk` _) =
+     let i = (case x of { HappyErrorToken (i) -> i }) in
+--     trace "shifting the error token" $
+     new_state i i tk (HappyState (new_state)) ((st):(sts)) (stk)
+
+happyShift new_state i tk st sts stk =
+     happyNewToken new_state ((st):(sts)) ((HappyTerminal (tk))`HappyStk`stk)
+
+-- happyReduce is specialised for the common cases.
+
+happySpecReduce_0 i fn (1) tk st sts stk
+     = happyFail (1) tk st sts stk
+happySpecReduce_0 nt fn j tk st@((HappyState (action))) sts stk
+     = action nt j tk st ((st):(sts)) (fn `HappyStk` stk)
+
+happySpecReduce_1 i fn (1) tk st sts stk
+     = happyFail (1) tk st sts stk
+happySpecReduce_1 nt fn j tk _ sts@(((st@(HappyState (action))):(_))) (v1`HappyStk`stk')
+     = let r = fn v1 in
+       happySeq r (action nt j tk st sts (r `HappyStk` stk'))
+
+happySpecReduce_2 i fn (1) tk st sts stk
+     = happyFail (1) tk st sts stk
+happySpecReduce_2 nt fn j tk _ ((_):(sts@(((st@(HappyState (action))):(_))))) (v1`HappyStk`v2`HappyStk`stk')
+     = let r = fn v1 v2 in
+       happySeq r (action nt j tk st sts (r `HappyStk` stk'))
+
+happySpecReduce_3 i fn (1) tk st sts stk
+     = happyFail (1) tk st sts stk
+happySpecReduce_3 nt fn j tk _ ((_):(((_):(sts@(((st@(HappyState (action))):(_))))))) (v1`HappyStk`v2`HappyStk`v3`HappyStk`stk')
+     = let r = fn v1 v2 v3 in
+       happySeq r (action nt j tk st sts (r `HappyStk` stk'))
+
+happyReduce k i fn (1) tk st sts stk
+     = happyFail (1) tk st sts stk
+happyReduce k nt fn j tk st sts stk
+     = case happyDrop (k - ((1) :: Int)) sts of
+         sts1@(((st1@(HappyState (action))):(_))) ->
+                let r = fn stk in  -- it doesn't hurt to always seq here...
+                happyDoSeq r (action nt j tk st1 sts1 r)
+
+happyMonadReduce k nt fn (1) tk st sts stk
+     = happyFail (1) tk st sts stk
+happyMonadReduce k nt fn j tk st sts stk =
+      case happyDrop k ((st):(sts)) of
+        sts1@(((st1@(HappyState (action))):(_))) ->
+          let drop_stk = happyDropStk k stk in
+          happyThen1 (fn stk tk) (\r -> action nt j tk st1 sts1 (r `HappyStk` drop_stk))
+
+happyMonad2Reduce k nt fn (1) tk st sts stk
+     = happyFail (1) tk st sts stk
+happyMonad2Reduce k nt fn j tk st sts stk =
+      case happyDrop k ((st):(sts)) of
+        sts1@(((st1@(HappyState (action))):(_))) ->
+         let drop_stk = happyDropStk k stk
+
+
+
+
+
+             new_state = action
+
+          in
+          happyThen1 (fn stk tk) (\r -> happyNewToken new_state sts1 (r `HappyStk` drop_stk))
+
+happyDrop (0) l = l
+happyDrop n ((_):(t)) = happyDrop (n - ((1) :: Int)) t
+
+happyDropStk (0) l = l
+happyDropStk n (x `HappyStk` xs) = happyDropStk (n - ((1)::Int)) xs
+
+-----------------------------------------------------------------------------
+-- Moving to a new state after a reduction
+
+{-# LINE 256 "templates/GenericTemplate.hs" #-}
+happyGoto action j tk st = action j j tk (HappyState action)
+
+
+-----------------------------------------------------------------------------
+-- Error recovery ((1) is the error token)
+
+-- parse error if we are in recovery and we fail again
+happyFail (1) tk old_st _ stk@(x `HappyStk` _) =
+     let i = (case x of { HappyErrorToken (i) -> i }) in
+--      trace "failing" $ 
+        happyError_ i tk
+
+{-  We don't need state discarding for our restricted implementation of
+    "error".  In fact, it can cause some bogus parses, so I've disabled it
+    for now --SDM
+
+-- discard a state
+happyFail  (1) tk old_st (((HappyState (action))):(sts)) 
+                                                (saved_tok `HappyStk` _ `HappyStk` stk) =
+--      trace ("discarding state, depth " ++ show (length stk))  $
+        action (1) (1) tk (HappyState (action)) sts ((saved_tok`HappyStk`stk))
+-}
+
+-- Enter error recovery: generate an error token,
+--                       save the old token and carry on.
+happyFail  i tk (HappyState (action)) sts stk =
+--      trace "entering error recovery" $
+        action (1) (1) tk (HappyState (action)) sts ( (HappyErrorToken (i)) `HappyStk` stk)
+
+-- Internal happy errors:
+
+notHappyAtAll :: a
+notHappyAtAll = error "Internal Happy error\n"
+
+-----------------------------------------------------------------------------
+-- Hack to get the typechecker to accept our action functions
+
+
+
+
+
+
+
+-----------------------------------------------------------------------------
+-- Seq-ing.  If the --strict flag is given, then Happy emits 
+--      happySeq = happyDoSeq
+-- otherwise it emits
+--      happySeq = happyDontSeq
+
+happyDoSeq, happyDontSeq :: a -> b -> b
+happyDoSeq   a b = a `seq` b
+happyDontSeq a b = b
+
+-----------------------------------------------------------------------------
+-- Don't inline any functions from the template.  GHC has a nasty habit
+-- of deciding to inline happyGoto everywhere, which increases the size of
+-- the generated parser quite a bit.
+
+{-# LINE 322 "templates/GenericTemplate.hs" #-}
+{-# NOINLINE happyShift #-}
+{-# NOINLINE happySpecReduce_0 #-}
+{-# NOINLINE happySpecReduce_1 #-}
+{-# NOINLINE happySpecReduce_2 #-}
+{-# NOINLINE happySpecReduce_3 #-}
+{-# NOINLINE happyReduce #-}
+{-# NOINLINE happyMonadReduce #-}
+{-# NOINLINE happyGoto #-}
+{-# NOINLINE happyFail #-}
+
+-- end of Happy Template.
diff --git a/src/ParBNF.y b/src/ParBNF.y
--- a/src/ParBNF.y
+++ b/src/ParBNF.y
@@ -11,11 +11,12 @@
 %name pLGrammar LGrammar
 %name pLDef LDef
 %name pListLDef ListLDef
+%name pListIdent ListIdent
 %name pGrammar Grammar
 %name pListDef ListDef
-%name pListItem ListItem
 %name pDef Def
 %name pItem Item
+%name pListItem ListItem
 %name pCat Cat
 %name pLabel Label
 %name pLabelId LabelId
@@ -24,28 +25,25 @@
 %name pListInteger ListInteger
 %name pListIntList ListIntList
 %name pListProfItem ListProfItem
-%name pSeparation Separation
 %name pArg Arg
 %name pListArg ListArg
+%name pSeparation Separation
+%name pListString ListString
 %name pExp Exp
 %name pExp1 Exp1
 %name pExp2 Exp2
-%name pListExp2 ListExp2
 %name pListExp ListExp
-%name pListString ListString
-%name pListRHS ListRHS
+%name pListExp2 ListExp2
 %name pRHS RHS
+%name pListRHS ListRHS
 %name pMinimumSize MinimumSize
 %name pReg2 Reg2
 %name pReg1 Reg1
 %name pReg3 Reg3
 %name pReg Reg
-%name pListIdent ListIdent
-
 -- no lexer declaration
 %monad { Err } { thenM } { returnM }
-%tokentype { Token }
-
+%tokentype {Token}
 %token
   '(' { PT _ (TS _ 1) }
   ')' { PT _ (TS _ 2) }
@@ -88,8 +86,8 @@
   '|' { PT _ (TS _ 39) }
   '}' { PT _ (TS _ 40) }
 
-L_quoted { PT _ (TL $$) }
 L_ident  { PT _ (TV $$) }
+L_quoted { PT _ (TL $$) }
 L_integ  { PT _ (TI $$) }
 L_charac { PT _ (TC $$) }
 L_doubl  { PT _ (TD $$) }
@@ -97,214 +95,139 @@
 
 %%
 
-String  :: { String }  : L_quoted {  $1 }
 Ident   :: { Ident }   : L_ident  { Ident $1 }
+String  :: { String }  : L_quoted {  $1 }
 Integer :: { Integer } : L_integ  { (read ( $1)) :: Integer }
 Char    :: { Char }    : L_charac { (read ( $1)) :: Char }
 Double  :: { Double }  : L_doubl  { (read ( $1)) :: Double }
 
 LGrammar :: { LGrammar }
-LGrammar : ListLDef { LGr $1 } 
-
-
+LGrammar : ListLDef { AbsBNF.LGr $1 }
 LDef :: { LDef }
-LDef : Def { DefAll $1 } 
-  | ListIdent ':' Def { DefSome $1 $3 }
-  | 'views' ListIdent { LDefView $2 }
-
-
+LDef : Def { AbsBNF.DefAll $1 }
+     | ListIdent ':' Def { AbsBNF.DefSome $1 $3 }
+     | 'views' ListIdent { AbsBNF.LDefView $2 }
 ListLDef :: { [LDef] }
-ListLDef : {- empty -} { [] } 
-  | LDef { (:[]) $1 }
-  | LDef ';' ListLDef { (:) $1 $3 }
-
-
+ListLDef : {- empty -} { [] }
+         | LDef { (:[]) $1 }
+         | LDef ';' ListLDef { (:) $1 $3 }
+         | ';' ListLDef { $2 }
+ListIdent :: { [Ident] }
+ListIdent : Ident { (:[]) $1 } | Ident ',' ListIdent { (:) $1 $3 }
 Grammar :: { Grammar }
-Grammar : ListDef { Grammar $1 } 
-
-
+Grammar : ListDef { AbsBNF.Grammar $1 }
 ListDef :: { [Def] }
-ListDef : {- empty -} { [] } 
-  | Def { (:[]) $1 }
-  | Def ';' ListDef { (:) $1 $3 }
-
-
-ListItem :: { [Item] }
-ListItem : {- empty -} { [] } 
-  | ListItem Item { flip (:) $1 $2 }
-
-
+ListDef : {- empty -} { [] }
+        | Def { (:[]) $1 }
+        | Def ';' ListDef { (:) $1 $3 }
+        | ';' ListDef { $2 }
 Def :: { Def }
-Def : Label '.' Cat '::=' ListItem { Rule $1 $3 (reverse $5) } 
-  | 'comment' String { Comment $2 }
-  | 'comment' String String { Comments $2 $3 }
-  | 'internal' Label '.' Cat '::=' ListItem { Internal $2 $4 (reverse $6) }
-  | 'token' Ident Reg { Token $2 $3 }
-  | 'position' 'token' Ident Reg { PosToken $3 $4 }
-  | 'entrypoints' ListIdent { Entryp $2 }
-  | 'separator' MinimumSize Cat String { Separator $2 $3 $4 }
-  | 'terminator' MinimumSize Cat String { Terminator $2 $3 $4 }
-  | 'delimiters' Cat String String Separation MinimumSize { Delimiters $2 $3 $4 $5 $6 }
-  | 'coercions' Ident Integer { Coercions $2 $3 }
-  | 'rules' Ident '::=' ListRHS { Rules $2 $4 }
-  | 'define' Ident ListArg '=' Exp { Function $2 (reverse $3) $5 }
-  | 'layout' ListString { Layout $2 }
-  | 'layout' 'stop' ListString { LayoutStop $3 }
-  | 'layout' 'toplevel' { LayoutTop }
-
-
+Def : Label '.' Cat '::=' ListItem { AbsBNF.Rule $1 $3 (reverse $5) }
+    | 'comment' String { AbsBNF.Comment $2 }
+    | 'comment' String String { AbsBNF.Comments $2 $3 }
+    | 'internal' Label '.' Cat '::=' ListItem { AbsBNF.Internal $2 $4 (reverse $6) }
+    | 'token' Ident Reg { AbsBNF.Token $2 $3 }
+    | 'position' 'token' Ident Reg { AbsBNF.PosToken $3 $4 }
+    | 'entrypoints' ListIdent { AbsBNF.Entryp $2 }
+    | 'separator' MinimumSize Cat String { AbsBNF.Separator $2 $3 $4 }
+    | 'terminator' MinimumSize Cat String { AbsBNF.Terminator $2 $3 $4 }
+    | 'delimiters' Cat String String Separation MinimumSize { AbsBNF.Delimiters $2 $3 $4 $5 $6 }
+    | 'coercions' Ident Integer { AbsBNF.Coercions $2 $3 }
+    | 'rules' Ident '::=' ListRHS { AbsBNF.Rules $2 $4 }
+    | 'define' Ident ListArg '=' Exp { AbsBNF.Function $2 (reverse $3) $5 }
+    | 'layout' ListString { AbsBNF.Layout $2 }
+    | 'layout' 'stop' ListString { AbsBNF.LayoutStop $3 }
+    | 'layout' 'toplevel' { AbsBNF.LayoutTop }
 Item :: { Item }
-Item : String { Terminal $1 } 
-  | Cat { NTerminal $1 }
-
-
+Item : String { AbsBNF.Terminal $1 } | Cat { AbsBNF.NTerminal $1 }
+ListItem :: { [Item] }
+ListItem : {- empty -} { [] } | ListItem Item { flip (:) $1 $2 }
 Cat :: { Cat }
-Cat : '[' Cat ']' { ListCat $2 } 
-  | Ident { IdCat $1 }
-
-
+Cat : '[' Cat ']' { AbsBNF.ListCat $2 } | Ident { AbsBNF.IdCat $1 }
 Label :: { Label }
-Label : LabelId { LabNoP $1 } 
-  | LabelId ListProfItem { LabP $1 $2 }
-  | LabelId LabelId ListProfItem { LabPF $1 $2 $3 }
-  | LabelId LabelId { LabF $1 $2 }
-
-
+Label : LabelId { AbsBNF.LabNoP $1 }
+      | LabelId ListProfItem { AbsBNF.LabP $1 $2 }
+      | LabelId LabelId ListProfItem { AbsBNF.LabPF $1 $2 $3 }
+      | LabelId LabelId { AbsBNF.LabF $1 $2 }
 LabelId :: { LabelId }
-LabelId : Ident { Id $1 } 
-  | '_' { Wild }
-  | '[' ']' { ListE }
-  | '(' ':' ')' { ListCons }
-  | '(' ':' '[' ']' ')' { ListOne }
-
-
+LabelId : Ident { AbsBNF.Id $1 }
+        | '_' { AbsBNF.Wild }
+        | '[' ']' { AbsBNF.ListE }
+        | '(' ':' ')' { AbsBNF.ListCons }
+        | '(' ':' '[' ']' ')' { AbsBNF.ListOne }
 ProfItem :: { ProfItem }
-ProfItem : '(' '[' ListIntList ']' ',' '[' ListInteger ']' ')' { ProfIt $3 $7 } 
-
-
+ProfItem : '(' '[' ListIntList ']' ',' '[' ListInteger ']' ')' { AbsBNF.ProfIt $3 $7 }
 IntList :: { IntList }
-IntList : '[' ListInteger ']' { Ints $2 } 
-
-
+IntList : '[' ListInteger ']' { AbsBNF.Ints $2 }
 ListInteger :: { [Integer] }
-ListInteger : {- empty -} { [] } 
-  | Integer { (:[]) $1 }
-  | Integer ',' ListInteger { (:) $1 $3 }
-
-
+ListInteger : {- empty -} { [] }
+            | Integer { (:[]) $1 }
+            | Integer ',' ListInteger { (:) $1 $3 }
 ListIntList :: { [IntList] }
-ListIntList : {- empty -} { [] } 
-  | IntList { (:[]) $1 }
-  | IntList ',' ListIntList { (:) $1 $3 }
-
-
+ListIntList : {- empty -} { [] }
+            | IntList { (:[]) $1 }
+            | IntList ',' ListIntList { (:) $1 $3 }
 ListProfItem :: { [ProfItem] }
-ListProfItem : ProfItem { (:[]) $1 } 
-  | ProfItem ListProfItem { (:) $1 $2 }
-
-
-Separation :: { Separation }
-Separation : {- empty -} { SepNone } 
-  | 'terminator' String { SepTerm $2 }
-  | 'separator' String { SepSepar $2 }
-
-
+ListProfItem : ProfItem { (:[]) $1 }
+             | ProfItem ListProfItem { (:) $1 $2 }
 Arg :: { Arg }
-Arg : Ident { Arg $1 } 
-
-
+Arg : Ident { AbsBNF.Arg $1 }
 ListArg :: { [Arg] }
-ListArg : {- empty -} { [] } 
-  | ListArg Arg { flip (:) $1 $2 }
-
-
+ListArg : {- empty -} { [] } | ListArg Arg { flip (:) $1 $2 }
+Separation :: { Separation }
+Separation : {- empty -} { AbsBNF.SepNone }
+           | 'terminator' String { AbsBNF.SepTerm $2 }
+           | 'separator' String { AbsBNF.SepSepar $2 }
+ListString :: { [String] }
+ListString : String { (:[]) $1 }
+           | String ',' ListString { (:) $1 $3 }
 Exp :: { Exp }
-Exp : Exp1 ':' Exp { Cons $1 $3 } 
-  | Exp1 { $1 }
-
-
+Exp : Exp1 ':' Exp { AbsBNF.Cons $1 $3 } | Exp1 { $1 }
 Exp1 :: { Exp }
-Exp1 : Ident ListExp2 { App $1 $2 } 
-  | Exp2 { $1 }
-
-
+Exp1 : Ident ListExp2 { AbsBNF.App $1 $2 } | Exp2 { $1 }
 Exp2 :: { Exp }
-Exp2 : Ident { Var $1 } 
-  | Integer { LitInt $1 }
-  | Char { LitChar $1 }
-  | String { LitString $1 }
-  | Double { LitDouble $1 }
-  | '[' ListExp ']' { List $2 }
-  | '(' Exp ')' { $2 }
-
-
-ListExp2 :: { [Exp] }
-ListExp2 : Exp2 { (:[]) $1 } 
-  | Exp2 ListExp2 { (:) $1 $2 }
-
-
+Exp2 : Ident { AbsBNF.Var $1 }
+     | Integer { AbsBNF.LitInt $1 }
+     | Char { AbsBNF.LitChar $1 }
+     | String { AbsBNF.LitString $1 }
+     | Double { AbsBNF.LitDouble $1 }
+     | '[' ListExp ']' { AbsBNF.List $2 }
+     | '(' Exp ')' { $2 }
 ListExp :: { [Exp] }
-ListExp : {- empty -} { [] } 
-  | Exp { (:[]) $1 }
-  | Exp ',' ListExp { (:) $1 $3 }
-
-
-ListString :: { [String] }
-ListString : String { (:[]) $1 } 
-  | String ',' ListString { (:) $1 $3 }
-
-
-ListRHS :: { [RHS] }
-ListRHS : RHS { (:[]) $1 } 
-  | RHS '|' ListRHS { (:) $1 $3 }
-
-
+ListExp : {- empty -} { [] }
+        | Exp { (:[]) $1 }
+        | Exp ',' ListExp { (:) $1 $3 }
+ListExp2 :: { [Exp] }
+ListExp2 : Exp2 { (:[]) $1 } | Exp2 ListExp2 { (:) $1 $2 }
 RHS :: { RHS }
-RHS : ListItem { RHS (reverse $1) } 
-
-
+RHS : ListItem { AbsBNF.RHS (reverse $1) }
+ListRHS :: { [RHS] }
+ListRHS : RHS { (:[]) $1 } | RHS '|' ListRHS { (:) $1 $3 }
 MinimumSize :: { MinimumSize }
-MinimumSize : 'nonempty' { MNonempty } 
-  | {- empty -} { MEmpty }
-
-
+MinimumSize : 'nonempty' { AbsBNF.MNonempty }
+            | {- empty -} { AbsBNF.MEmpty }
 Reg2 :: { Reg }
-Reg2 : Reg2 Reg3 { RSeq $1 $2 } 
-  | Reg3 { $1 }
-
-
+Reg2 : Reg2 Reg3 { AbsBNF.RSeq $1 $2 } | Reg3 { $1 }
 Reg1 :: { Reg }
-Reg1 : Reg1 '|' Reg2 { RAlt $1 $3 } 
-  | Reg2 '-' Reg2 { RMinus $1 $3 }
-  | Reg2 { $1 }
-
-
+Reg1 : Reg1 '|' Reg2 { AbsBNF.RAlt $1 $3 }
+     | Reg2 '-' Reg2 { AbsBNF.RMinus $1 $3 }
+     | Reg2 { $1 }
 Reg3 :: { Reg }
-Reg3 : Reg3 '*' { RStar $1 } 
-  | Reg3 '+' { RPlus $1 }
-  | Reg3 '?' { ROpt $1 }
-  | 'eps' { REps }
-  | Char { RChar $1 }
-  | '[' String ']' { RAlts $2 }
-  | '{' String '}' { RSeqs $2 }
-  | 'digit' { RDigit }
-  | 'letter' { RLetter }
-  | 'upper' { RUpper }
-  | 'lower' { RLower }
-  | 'char' { RAny }
-  | '(' Reg ')' { $2 }
-
-
+Reg3 : Reg3 '*' { AbsBNF.RStar $1 }
+     | Reg3 '+' { AbsBNF.RPlus $1 }
+     | Reg3 '?' { AbsBNF.ROpt $1 }
+     | 'eps' { AbsBNF.REps }
+     | Char { AbsBNF.RChar $1 }
+     | '[' String ']' { AbsBNF.RAlts $2 }
+     | '{' String '}' { AbsBNF.RSeqs $2 }
+     | 'digit' { AbsBNF.RDigit }
+     | 'letter' { AbsBNF.RLetter }
+     | 'upper' { AbsBNF.RUpper }
+     | 'lower' { AbsBNF.RLower }
+     | 'char' { AbsBNF.RAny }
+     | '(' Reg ')' { $2 }
 Reg :: { Reg }
-Reg : Reg1 { $1 } 
-
-
-ListIdent :: { [Ident] }
-ListIdent : Ident { (:[]) $1 } 
-  | Ident ',' ListIdent { (:) $1 $3 }
-
-
-
+Reg : Reg1 { $1 }
 {
 
 returnM :: a -> Err a
@@ -319,7 +242,7 @@
   case ts of
     [] -> []
     [Err _] -> " due to lexer error"
-    _ -> " before " ++ unwords (map (id . prToken) (take 4 ts))
+    t:_ -> " before `" ++ id(prToken t) ++ "'"
 
 myLexer = tokens
 }
diff --git a/src/PrintBNF.hs b/src/PrintBNF.hs
--- a/src/PrintBNF.hs
+++ b/src/PrintBNF.hs
@@ -25,14 +25,19 @@
     "}" : ";":ts -> new (i-1) . space "}" . showChar ';' . new (i-1) . rend (i-1) ts
     "}"      :ts -> new (i-1) . showChar '}' . new (i-1) . rend (i-1) ts
     ";"      :ts -> showChar ';' . new i . rend i ts
-    t  : "," :ts -> showString t . space "," . rend i ts
-    t  : ")" :ts -> showString t . showChar ')' . rend i ts
-    t  : "]" :ts -> showString t . showChar ']' . rend i ts
+    t  : ts@(p:_) | closingOrPunctuation p -> showString t . rend i ts
     t        :ts -> space t . rend i ts
     _            -> id
   new i   = showChar '\n' . replicateS (2*i) (showChar ' ') . dropWhile isSpace
-  space t = showString t . (\s -> if null s then "" else (' ':s))
+  space t = showString t . (\s -> if null s then "" else ' ':s)
 
+  closingOrPunctuation :: String -> Bool
+  closingOrPunctuation [c] = c `elem` closerOrPunct
+  closingOrPunctuation _   = False
+
+  closerOrPunct :: String
+  closerOrPunct = ")],;"
+
 parenth :: Doc -> Doc
 parenth ss = doc (showChar '(') . ss . doc (showChar ')')
 
@@ -48,15 +53,15 @@
 -- the printer class does the job
 class Print a where
   prt :: Int -> a -> Doc
-  prtList :: [a] -> Doc
-  prtList = concatD . map (prt 0)
+  prtList :: Int -> [a] -> Doc
+  prtList i = concatD . map (prt i)
 
 instance Print a => Print [a] where
-  prt _ = prtList
+  prt = prtList
 
 instance Print Char where
   prt _ s = doc (showChar '\'' . mkEsc '\'' s . showChar '\'')
-  prtList s = doc (showChar '"' . concatS (map (mkEsc '"') s) . showChar '"')
+  prtList _ s = doc (showChar '"' . concatS (map (mkEsc '"') s) . showChar '"')
 
 mkEsc :: Char -> Char -> ShowS
 mkEsc q s = case s of
@@ -72,10 +77,6 @@
 
 instance Print Integer where
   prt _ x = doc (shows x)
-  prtList es = case es of
-   [] -> (concatD [])
-   [x] -> (concatD [prt 0 x])
-   x:xs -> (concatD [prt 0 x , doc (showString ",") , prt 0 xs])
 
 
 instance Print Double where
@@ -83,171 +84,135 @@
 
 
 instance Print Ident where
-  prt _ (Ident i) = doc (showString ( i))
-  prtList es = case es of
-   [x] -> (concatD [prt 0 x])
-   x:xs -> (concatD [prt 0 x , doc (showString ",") , prt 0 xs])
-
-
+  prt _ (Ident i) = doc (showString i)
+  prtList _ [x] = concatD [prt 0 x]
+  prtList _ (x:xs) = concatD [prt 0 x, doc (showString ","), prt 0 xs]
 
 instance Print LGrammar where
   prt i e = case e of
-   LGr ldefs -> prPrec i 0 (concatD [prt 0 ldefs])
-
+    LGr ldefs -> prPrec i 0 (concatD [prt 0 ldefs])
 
 instance Print LDef where
   prt i e = case e of
-   DefAll def -> prPrec i 0 (concatD [prt 0 def])
-   DefSome ids def -> prPrec i 0 (concatD [prt 0 ids , doc (showString ":") , prt 0 def])
-   LDefView ids -> prPrec i 0 (concatD [doc (showString "views") , prt 0 ids])
-
-  prtList es = case es of
-   [] -> (concatD [])
-   [x] -> (concatD [prt 0 x])
-   x:xs -> (concatD [prt 0 x , doc (showString ";") , prt 0 xs])
-
+    DefAll def -> prPrec i 0 (concatD [prt 0 def])
+    DefSome ids def -> prPrec i 0 (concatD [prt 0 ids, doc (showString ":"), prt 0 def])
+    LDefView ids -> prPrec i 0 (concatD [doc (showString "views"), prt 0 ids])
+  prtList _ [] = concatD []
+  prtList _ [x] = concatD [prt 0 x]
+  prtList _ (x:xs) = concatD [prt 0 x, doc (showString ";"), prt 0 xs]
 instance Print Grammar where
   prt i e = case e of
-   Grammar defs -> prPrec i 0 (concatD [prt 0 defs])
-
+    Grammar defs -> prPrec i 0 (concatD [prt 0 defs])
 
 instance Print Def where
   prt i e = case e of
-   Rule label cat items -> prPrec i 0 (concatD [prt 0 label , doc (showString ".") , prt 0 cat , doc (showString "::=") , prt 0 items])
-   Comment str -> prPrec i 0 (concatD [doc (showString "comment") , prt 0 str])
-   Comments str0 str -> prPrec i 0 (concatD [doc (showString "comment") , prt 0 str0 , prt 0 str])
-   Internal label cat items -> prPrec i 0 (concatD [doc (showString "internal") , prt 0 label , doc (showString ".") , prt 0 cat , doc (showString "::=") , prt 0 items])
-   Token id reg -> prPrec i 0 (concatD [doc (showString "token") , prt 0 id , prt 0 reg])
-   PosToken id reg -> prPrec i 0 (concatD [doc (showString "position") , doc (showString "token") , prt 0 id , prt 0 reg])
-   Entryp ids -> prPrec i 0 (concatD [doc (showString "entrypoints") , prt 0 ids])
-   Separator minimumsize cat str -> prPrec i 0 (concatD [doc (showString "separator") , prt 0 minimumsize , prt 0 cat , prt 0 str])
-   Terminator minimumsize cat str -> prPrec i 0 (concatD [doc (showString "terminator") , prt 0 minimumsize , prt 0 cat , prt 0 str])
-   Delimiters cat str0 str separation minimumsize -> prPrec i 0 (concatD [doc (showString "delimiters") , prt 0 cat , prt 0 str0 , prt 0 str , prt 0 separation , prt 0 minimumsize])
-   Coercions id n -> prPrec i 0 (concatD [doc (showString "coercions") , prt 0 id , prt 0 n])
-   Rules id rhss -> prPrec i 0 (concatD [doc (showString "rules") , prt 0 id , doc (showString "::=") , prt 0 rhss])
-   Function id args exp -> prPrec i 0 (concatD [doc (showString "define") , prt 0 id , prt 0 args , doc (showString "=") , prt 0 exp])
-   Layout strs -> prPrec i 0 (concatD [doc (showString "layout") , prt 0 strs])
-   LayoutStop strs -> prPrec i 0 (concatD [doc (showString "layout") , doc (showString "stop") , prt 0 strs])
-   LayoutTop  -> prPrec i 0 (concatD [doc (showString "layout") , doc (showString "toplevel")])
-
-  prtList es = case es of
-   [] -> (concatD [])
-   [x] -> (concatD [prt 0 x])
-   x:xs -> (concatD [prt 0 x , doc (showString ";") , prt 0 xs])
-
+    Rule label cat items -> prPrec i 0 (concatD [prt 0 label, doc (showString "."), prt 0 cat, doc (showString "::="), prt 0 items])
+    Comment str -> prPrec i 0 (concatD [doc (showString "comment"), prt 0 str])
+    Comments str1 str2 -> prPrec i 0 (concatD [doc (showString "comment"), prt 0 str1, prt 0 str2])
+    Internal label cat items -> prPrec i 0 (concatD [doc (showString "internal"), prt 0 label, doc (showString "."), prt 0 cat, doc (showString "::="), prt 0 items])
+    Token id reg -> prPrec i 0 (concatD [doc (showString "token"), prt 0 id, prt 0 reg])
+    PosToken id reg -> prPrec i 0 (concatD [doc (showString "position"), doc (showString "token"), prt 0 id, prt 0 reg])
+    Entryp ids -> prPrec i 0 (concatD [doc (showString "entrypoints"), prt 0 ids])
+    Separator minimumsize cat str -> prPrec i 0 (concatD [doc (showString "separator"), prt 0 minimumsize, prt 0 cat, prt 0 str])
+    Terminator minimumsize cat str -> prPrec i 0 (concatD [doc (showString "terminator"), prt 0 minimumsize, prt 0 cat, prt 0 str])
+    Delimiters cat str1 str2 separation minimumsize -> prPrec i 0 (concatD [doc (showString "delimiters"), prt 0 cat, prt 0 str1, prt 0 str2, prt 0 separation, prt 0 minimumsize])
+    Coercions id n -> prPrec i 0 (concatD [doc (showString "coercions"), prt 0 id, prt 0 n])
+    Rules id rhss -> prPrec i 0 (concatD [doc (showString "rules"), prt 0 id, doc (showString "::="), prt 0 rhss])
+    Function id args exp -> prPrec i 0 (concatD [doc (showString "define"), prt 0 id, prt 0 args, doc (showString "="), prt 0 exp])
+    Layout strs -> prPrec i 0 (concatD [doc (showString "layout"), prt 0 strs])
+    LayoutStop strs -> prPrec i 0 (concatD [doc (showString "layout"), doc (showString "stop"), prt 0 strs])
+    LayoutTop -> prPrec i 0 (concatD [doc (showString "layout"), doc (showString "toplevel")])
+  prtList _ [] = concatD []
+  prtList _ [x] = concatD [prt 0 x]
+  prtList _ (x:xs) = concatD [prt 0 x, doc (showString ";"), prt 0 xs]
 instance Print Item where
   prt i e = case e of
-   Terminal str -> prPrec i 0 (concatD [prt 0 str])
-   NTerminal cat -> prPrec i 0 (concatD [prt 0 cat])
-
-  prtList es = case es of
-   [] -> (concatD [])
-   x:xs -> (concatD [prt 0 x , prt 0 xs])
-
+    Terminal str -> prPrec i 0 (concatD [prt 0 str])
+    NTerminal cat -> prPrec i 0 (concatD [prt 0 cat])
+  prtList _ [] = concatD []
+  prtList _ (x:xs) = concatD [prt 0 x, prt 0 xs]
 instance Print Cat where
   prt i e = case e of
-   ListCat cat -> prPrec i 0 (concatD [doc (showString "[") , prt 0 cat , doc (showString "]")])
-   IdCat id -> prPrec i 0 (concatD [prt 0 id])
-
+    ListCat cat -> prPrec i 0 (concatD [doc (showString "["), prt 0 cat, doc (showString "]")])
+    IdCat id -> prPrec i 0 (concatD [prt 0 id])
 
 instance Print Label where
   prt i e = case e of
-   LabNoP labelid -> prPrec i 0 (concatD [prt 0 labelid])
-   LabP labelid profitems -> prPrec i 0 (concatD [prt 0 labelid , prt 0 profitems])
-   LabPF labelid0 labelid profitems -> prPrec i 0 (concatD [prt 0 labelid0 , prt 0 labelid , prt 0 profitems])
-   LabF labelid0 labelid -> prPrec i 0 (concatD [prt 0 labelid0 , prt 0 labelid])
-
+    LabNoP labelid -> prPrec i 0 (concatD [prt 0 labelid])
+    LabP labelid profitems -> prPrec i 0 (concatD [prt 0 labelid, prt 0 profitems])
+    LabPF labelid1 labelid2 profitems -> prPrec i 0 (concatD [prt 0 labelid1, prt 0 labelid2, prt 0 profitems])
+    LabF labelid1 labelid2 -> prPrec i 0 (concatD [prt 0 labelid1, prt 0 labelid2])
 
 instance Print LabelId where
   prt i e = case e of
-   Id id -> prPrec i 0 (concatD [prt 0 id])
-   Wild  -> prPrec i 0 (concatD [doc (showString "_")])
-   ListE  -> prPrec i 0 (concatD [doc (showString "[") , doc (showString "]")])
-   ListCons  -> prPrec i 0 (concatD [doc (showString "(") , doc (showString ":") , doc (showString ")")])
-   ListOne  -> prPrec i 0 (concatD [doc (showString "(") , doc (showString ":") , doc (showString "[") , doc (showString "]") , doc (showString ")")])
-
+    Id id -> prPrec i 0 (concatD [prt 0 id])
+    Wild -> prPrec i 0 (concatD [doc (showString "_")])
+    ListE -> prPrec i 0 (concatD [doc (showString "["), doc (showString "]")])
+    ListCons -> prPrec i 0 (concatD [doc (showString "("), doc (showString ":"), doc (showString ")")])
+    ListOne -> prPrec i 0 (concatD [doc (showString "("), doc (showString ":"), doc (showString "["), doc (showString "]"), doc (showString ")")])
 
 instance Print ProfItem where
   prt i e = case e of
-   ProfIt intlists ns -> prPrec i 0 (concatD [doc (showString "(") , doc (showString "[") , prt 0 intlists , doc (showString "]") , doc (showString ",") , doc (showString "[") , prt 0 ns , doc (showString "]") , doc (showString ")")])
-
-  prtList es = case es of
-   [x] -> (concatD [prt 0 x])
-   x:xs -> (concatD [prt 0 x , prt 0 xs])
-
+    ProfIt intlists ns -> prPrec i 0 (concatD [doc (showString "("), doc (showString "["), prt 0 intlists, doc (showString "]"), doc (showString ","), doc (showString "["), prt 0 ns, doc (showString "]"), doc (showString ")")])
+  prtList _ [x] = concatD [prt 0 x]
+  prtList _ (x:xs) = concatD [prt 0 x, prt 0 xs]
 instance Print IntList where
   prt i e = case e of
-   Ints ns -> prPrec i 0 (concatD [doc (showString "[") , prt 0 ns , doc (showString "]")])
-
-  prtList es = case es of
-   [] -> (concatD [])
-   [x] -> (concatD [prt 0 x])
-   x:xs -> (concatD [prt 0 x , doc (showString ",") , prt 0 xs])
-
-instance Print Separation where
-  prt i e = case e of
-   SepNone  -> prPrec i 0 (concatD [])
-   SepTerm str -> prPrec i 0 (concatD [doc (showString "terminator") , prt 0 str])
-   SepSepar str -> prPrec i 0 (concatD [doc (showString "separator") , prt 0 str])
-
-
+    Ints ns -> prPrec i 0 (concatD [doc (showString "["), prt 0 ns, doc (showString "]")])
+  prtList _ [] = concatD []
+  prtList _ [x] = concatD [prt 0 x]
+  prtList _ (x:xs) = concatD [prt 0 x, doc (showString ","), prt 0 xs]
 instance Print Arg where
   prt i e = case e of
-   Arg id -> prPrec i 0 (concatD [prt 0 id])
-
-  prtList es = case es of
-   [] -> (concatD [])
-   x:xs -> (concatD [prt 0 x , prt 0 xs])
+    Arg id -> prPrec i 0 (concatD [prt 0 id])
+  prtList _ [] = concatD []
+  prtList _ (x:xs) = concatD [prt 0 x, prt 0 xs]
+instance Print Separation where
+  prt i e = case e of
+    SepNone -> prPrec i 0 (concatD [])
+    SepTerm str -> prPrec i 0 (concatD [doc (showString "terminator"), prt 0 str])
+    SepSepar str -> prPrec i 0 (concatD [doc (showString "separator"), prt 0 str])
 
 instance Print Exp where
   prt i e = case e of
-   Cons exp0 exp -> prPrec i 0 (concatD [prt 1 exp0 , doc (showString ":") , prt 0 exp])
-   App id exps -> prPrec i 1 (concatD [prt 0 id , prt 0 exps])
-   Var id -> prPrec i 2 (concatD [prt 0 id])
-   LitInt n -> prPrec i 2 (concatD [prt 0 n])
-   LitChar c -> prPrec i 2 (concatD [prt 0 c])
-   LitString str -> prPrec i 2 (concatD [prt 0 str])
-   LitDouble d -> prPrec i 2 (concatD [prt 0 d])
-   List exps -> prPrec i 2 (concatD [doc (showString "[") , prt 0 exps , doc (showString "]")])
-
-  prtList es = case es of
-   [] -> (concatD [])
-   [x] -> (concatD [prt 2 x])
-   [x] -> (concatD [prt 0 x])
-   x:xs -> (concatD [prt 2 x , prt 0 xs])
-   x:xs -> (concatD [prt 0 x , doc (showString ",") , prt 0 xs])
-
+    Cons exp1 exp2 -> prPrec i 0 (concatD [prt 1 exp1, doc (showString ":"), prt 0 exp2])
+    App id exps -> prPrec i 1 (concatD [prt 0 id, prt 2 exps])
+    Var id -> prPrec i 2 (concatD [prt 0 id])
+    LitInt n -> prPrec i 2 (concatD [prt 0 n])
+    LitChar c -> prPrec i 2 (concatD [prt 0 c])
+    LitString str -> prPrec i 2 (concatD [prt 0 str])
+    LitDouble d -> prPrec i 2 (concatD [prt 0 d])
+    List exps -> prPrec i 2 (concatD [doc (showString "["), prt 0 exps, doc (showString "]")])
+  prtList 2 [x] = concatD [prt 2 x]
+  prtList 2 (x:xs) = concatD [prt 2 x, prt 2 xs]
+  prtList _ [] = concatD []
+  prtList _ [x] = concatD [prt 0 x]
+  prtList _ (x:xs) = concatD [prt 0 x, doc (showString ","), prt 0 xs]
 instance Print RHS where
   prt i e = case e of
-   RHS items -> prPrec i 0 (concatD [prt 0 items])
-
-  prtList es = case es of
-   [x] -> (concatD [prt 0 x])
-   x:xs -> (concatD [prt 0 x , doc (showString "|") , prt 0 xs])
-
+    RHS items -> prPrec i 0 (concatD [prt 0 items])
+  prtList _ [x] = concatD [prt 0 x]
+  prtList _ (x:xs) = concatD [prt 0 x, doc (showString "|"), prt 0 xs]
 instance Print MinimumSize where
   prt i e = case e of
-   MNonempty  -> prPrec i 0 (concatD [doc (showString "nonempty")])
-   MEmpty  -> prPrec i 0 (concatD [])
-
+    MNonempty -> prPrec i 0 (concatD [doc (showString "nonempty")])
+    MEmpty -> prPrec i 0 (concatD [])
 
 instance Print Reg where
   prt i e = case e of
-   RSeq reg0 reg -> prPrec i 2 (concatD [prt 2 reg0 , prt 3 reg])
-   RAlt reg0 reg -> prPrec i 1 (concatD [prt 1 reg0 , doc (showString "|") , prt 2 reg])
-   RMinus reg0 reg -> prPrec i 1 (concatD [prt 2 reg0 , doc (showString "-") , prt 2 reg])
-   RStar reg -> prPrec i 3 (concatD [prt 3 reg , doc (showString "*")])
-   RPlus reg -> prPrec i 3 (concatD [prt 3 reg , doc (showString "+")])
-   ROpt reg -> prPrec i 3 (concatD [prt 3 reg , doc (showString "?")])
-   REps  -> prPrec i 3 (concatD [doc (showString "eps")])
-   RChar c -> prPrec i 3 (concatD [prt 0 c])
-   RAlts str -> prPrec i 3 (concatD [doc (showString "[") , prt 0 str , doc (showString "]")])
-   RSeqs str -> prPrec i 3 (concatD [doc (showString "{") , prt 0 str , doc (showString "}")])
-   RDigit  -> prPrec i 3 (concatD [doc (showString "digit")])
-   RLetter  -> prPrec i 3 (concatD [doc (showString "letter")])
-   RUpper  -> prPrec i 3 (concatD [doc (showString "upper")])
-   RLower  -> prPrec i 3 (concatD [doc (showString "lower")])
-   RAny  -> prPrec i 3 (concatD [doc (showString "char")])
-
-
+    RSeq reg1 reg2 -> prPrec i 2 (concatD [prt 2 reg1, prt 3 reg2])
+    RAlt reg1 reg2 -> prPrec i 1 (concatD [prt 1 reg1, doc (showString "|"), prt 2 reg2])
+    RMinus reg1 reg2 -> prPrec i 1 (concatD [prt 2 reg1, doc (showString "-"), prt 2 reg2])
+    RStar reg -> prPrec i 3 (concatD [prt 3 reg, doc (showString "*")])
+    RPlus reg -> prPrec i 3 (concatD [prt 3 reg, doc (showString "+")])
+    ROpt reg -> prPrec i 3 (concatD [prt 3 reg, doc (showString "?")])
+    REps -> prPrec i 3 (concatD [doc (showString "eps")])
+    RChar c -> prPrec i 3 (concatD [prt 0 c])
+    RAlts str -> prPrec i 3 (concatD [doc (showString "["), prt 0 str, doc (showString "]")])
+    RSeqs str -> prPrec i 3 (concatD [doc (showString "{"), prt 0 str, doc (showString "}")])
+    RDigit -> prPrec i 3 (concatD [doc (showString "digit")])
+    RLetter -> prPrec i 3 (concatD [doc (showString "letter")])
+    RUpper -> prPrec i 3 (concatD [doc (showString "upper")])
+    RLower -> prPrec i 3 (concatD [doc (showString "lower")])
+    RAny -> prPrec i 3 (concatD [doc (showString "char")])
 
diff --git a/test/BNFC/Backend/BaseSpec.hs b/test/BNFC/Backend/BaseSpec.hs
new file mode 100644
--- /dev/null
+++ b/test/BNFC/Backend/BaseSpec.hs
@@ -0,0 +1,54 @@
+{-# LANGUAGE FlexibleInstances, UndecidableInstances #-}
+{-# LANGUAGE ExtendedDefaultRules #-}
+module BNFC.Backend.BaseSpec where
+
+import Control.Monad (liftM, liftM2)
+import Data.List (intercalate)
+import Data.Maybe (fromJust)
+import System.Directory
+import System.FilePath ((<.>), takeBaseName)
+import System.IO.Temp (withSystemTempDirectory)
+import Test.Hspec
+import Test.QuickCheck
+
+import BNFC.Backend.Base -- SUT
+
+default(String)
+
+spec :: Spec
+spec = do
+  describe "Backend monad" $ do
+    it "empty computation generates empty list op files" $
+      execBackend (return ()) `shouldReturn` []
+    it "returns the file created using mkfile" $
+      execBackend (mkfile "test.txt" "abcd")
+        `shouldReturn` [("test.txt", "abcd")]
+  describe "writeFiles" $ do
+    it "creates the root directory if it doesn't exists" $
+      withSystemTempDirectory "bnfc-test" $ \tmpdir -> do
+        setCurrentDirectory tmpdir
+        writeFiles "foo/bar" (return ())
+        doesDirectoryExist "foo/bar" `shouldReturn` True
+    it "creates a file from the bucket" $
+      withSystemTempDirectory "bnfc-test" $ \tmpdir -> do
+        setCurrentDirectory tmpdir
+        writeFiles "." (mkfile "file.txt" "")
+        doesFileExist "file.txt"
+      `shouldReturn` True
+    it "put the right content in the file" $
+      withSystemTempDirectory "bnfc-test" $ \tmpdir -> do
+        setCurrentDirectory tmpdir
+        writeFiles "." (mkfile "file.txt" "abcd")
+        readFile "file.txt"
+      `shouldReturn` "abcd"
+    it "creates subdirectories" $
+      withSystemTempDirectory "bnfc-test" $ \tmpdir -> do
+        setCurrentDirectory tmpdir
+        writeFiles "." (mkfile "subdir/file.txt" "abcd")
+        doesDirectoryExist "subdir"
+      `shouldReturn` True
+    it "creates files in the root directory" $
+      withSystemTempDirectory "bnfc-test" $ \tmpdir -> do
+        setCurrentDirectory tmpdir
+        writeFiles "root/" (mkfile "foo/bar.txt" "abcd")
+        doesFileExist "root/foo/bar.txt" `shouldReturn` True
diff --git a/test/BNFC/Backend/CPP/NoSTLSpec.hs b/test/BNFC/Backend/CPP/NoSTLSpec.hs
new file mode 100644
--- /dev/null
+++ b/test/BNFC/Backend/CPP/NoSTLSpec.hs
@@ -0,0 +1,25 @@
+module BNFC.Backend.CPP.NoSTLSpec where
+
+import BNFC.Options
+import BNFC.GetCF
+
+import Test.Hspec
+import BNFC.Hspec
+
+import BNFC.Backend.CPP.NoSTL -- SUT
+
+calcOptions = defaultOptions { lang = "Calc" }
+getCalc = parseCF  calcOptions TargetCpp $
+  unlines [ "EAdd. Exp ::= Exp \"+\" Exp1  ;"
+          , "ESub. Exp ::= Exp \"-\" Exp1  ;"
+          , "EMul. Exp1  ::= Exp1  \"*\" Exp2  ;"
+          , "EDiv. Exp1  ::= Exp1  \"/\" Exp2  ;"
+          , "EInt. Exp2  ::= Integer ;"
+          , "coercions Exp 2 ;" ]
+
+spec =
+  describe "C backend" $
+    it "respect the makefile option" $ do
+      calc <- getCalc
+      let opts = calcOptions { make = Just "MyMakefile" }
+      makeCppNoStl opts calc `shouldGenerate` "MyMakefile"
diff --git a/test/BNFC/Backend/CPP/STLSpec.hs b/test/BNFC/Backend/CPP/STLSpec.hs
new file mode 100644
--- /dev/null
+++ b/test/BNFC/Backend/CPP/STLSpec.hs
@@ -0,0 +1,25 @@
+module BNFC.Backend.CPP.STLSpec where
+
+import BNFC.Options
+import BNFC.GetCF
+
+import Test.Hspec
+import BNFC.Hspec
+
+import BNFC.Backend.CPP.STL -- SUT
+
+calcOptions = defaultOptions { lang = "Calc" }
+getCalc = parseCF  calcOptions TargetCpp $
+  unlines [ "EAdd. Exp ::= Exp \"+\" Exp1  ;"
+          , "ESub. Exp ::= Exp \"-\" Exp1  ;"
+          , "EMul. Exp1  ::= Exp1  \"*\" Exp2  ;"
+          , "EDiv. Exp1  ::= Exp1  \"/\" Exp2  ;"
+          , "EInt. Exp2  ::= Integer ;"
+          , "coercions Exp 2 ;" ]
+
+spec =
+  describe "C backend" $
+    it "respect the makefile option" $ do
+      calc <- getCalc
+      let opts = calcOptions { make = Just "MyMakefile" }
+      makeCppStl opts calc `shouldGenerate` "MyMakefile"
diff --git a/test/BNFC/Backend/CSharpSpec.hs b/test/BNFC/Backend/CSharpSpec.hs
new file mode 100644
--- /dev/null
+++ b/test/BNFC/Backend/CSharpSpec.hs
@@ -0,0 +1,26 @@
+module BNFC.Backend.CSharpSpec where
+
+import BNFC.Options
+import BNFC.GetCF
+
+import Test.Hspec
+import BNFC.Hspec
+
+import BNFC.Backend.CSharp -- SUT
+
+calcOptions = defaultOptions { lang = "Calc" }
+getCalc = parseCF  calcOptions TargetCSharp $
+  unlines [ "EAdd. Exp ::= Exp \"+\" Exp1  ;"
+          , "ESub. Exp ::= Exp \"-\" Exp1  ;"
+          , "EMul. Exp1  ::= Exp1  \"*\" Exp2  ;"
+          , "EDiv. Exp1  ::= Exp1  \"/\" Exp2  ;"
+          , "EInt. Exp2  ::= Integer ;"
+          , "coercions Exp 2 ;" ]
+
+spec =
+  describe "C# backend" $
+    it "respect the makefile option" $ do
+      calc <- getCalc
+      let opts = calcOptions { make = Just "MyMakefile" }
+      makeCSharp opts calc `shouldGenerate` "MyMakefile"
+
diff --git a/test/BNFC/Backend/CSpec.hs b/test/BNFC/Backend/CSpec.hs
new file mode 100644
--- /dev/null
+++ b/test/BNFC/Backend/CSpec.hs
@@ -0,0 +1,25 @@
+module BNFC.Backend.CSpec where
+
+import BNFC.Options
+import BNFC.GetCF
+
+import Test.Hspec
+import BNFC.Hspec
+
+import BNFC.Backend.C -- SUT
+
+calcOptions = defaultOptions { lang = "Calc" }
+getCalc = parseCF  calcOptions TargetHaskell $
+  unlines [ "EAdd. Exp ::= Exp \"+\" Exp1  ;"
+          , "ESub. Exp ::= Exp \"-\" Exp1  ;"
+          , "EMul. Exp1  ::= Exp1  \"*\" Exp2  ;"
+          , "EDiv. Exp1  ::= Exp1  \"/\" Exp2  ;"
+          , "EInt. Exp2  ::= Integer ;"
+          , "coercions Exp 2 ;" ]
+
+spec =
+  describe "C backend" $
+    it "respect the makefile option" $ do
+      calc <- getCalc
+      let opts = calcOptions { make = Just "MyMakefile" }
+      makeC opts calc `shouldGenerate` "MyMakefile"
diff --git a/test/BNFC/Backend/Common/MakefileSpec.hs b/test/BNFC/Backend/Common/MakefileSpec.hs
--- a/test/BNFC/Backend/Common/MakefileSpec.hs
+++ b/test/BNFC/Backend/Common/MakefileSpec.hs
@@ -8,21 +8,6 @@
 
 spec :: Spec
 spec = do
-  describe "mkRule" $ do
-
-    it "produces makefile rules correctly" $
-      mkRule "main" ["file1","file2"] ["do something"] ""
-        `shouldBe` "main: file1 file2\n\tdo something\n\n"
-
-    it "produce mafefile rules without receipes" $
-      mkRule "main" ["program.exe"] [] ""
-       `shouldBe` "main: program.exe\n\n"
-
-  describe "mkVar" $
-    it "writes variables" $
-      mkVar "FOO" "bar" "" `shouldBe` "FOO=bar\n"
-
-
   describe "mkMakefile" $ do
     it "uses the names in the options dictionary" $
       let opts = defaultOptions { make = Just "MyMakefile" } in
diff --git a/test/BNFC/Backend/Common/NamedVariablesSpec.hs b/test/BNFC/Backend/Common/NamedVariablesSpec.hs
new file mode 100644
--- /dev/null
+++ b/test/BNFC/Backend/Common/NamedVariablesSpec.hs
@@ -0,0 +1,28 @@
+module BNFC.Backend.Common.NamedVariablesSpec where
+
+import Control.Monad (liftM)
+import Test.Hspec
+import Test.QuickCheck
+
+import BNFC.CF (Cat(..),isList)
+
+import BNFC.Backend.Common.NamedVariables -- SUT
+
+genCat:: Gen Cat
+genCat = frequency [(10,simpleCat), (1,listCat)]
+  where simpleCat = elements [Cat "Cat1", Cat "Cat2", Cat "Cat3"]
+        listCat   = liftM ListCat simpleCat
+
+spec :: Spec
+spec = do
+  describe "getVars" $ do
+
+    it "returns a list of the same length as the input list" $
+      forAll (listOf genCat) $ \l -> length l == length (getVars l)
+
+    it "leaves the name of the (non list) category untouched" $
+      forAll (listOf genCat) $ \l ->
+        all (not.isList) l ==> map show l == map fst (getVars l)
+
+    it "give the output described in the example" $
+      getVars [Cat "A", Cat "B", Cat "A"] `shouldBe` [("A", 1), ("B", 0), ("A", 2)]
diff --git a/test/BNFC/Backend/JavaSpec.hs b/test/BNFC/Backend/JavaSpec.hs
new file mode 100644
--- /dev/null
+++ b/test/BNFC/Backend/JavaSpec.hs
@@ -0,0 +1,24 @@
+module BNFC.Backend.JavaSpec where
+
+import BNFC.Options
+import BNFC.GetCF
+
+import Test.Hspec
+import BNFC.Hspec
+import BNFC.Backend.Java -- SUT
+
+calcOptions = defaultOptions { lang = "Calc" }
+getCalc = parseCF  calcOptions TargetJava $
+  unlines [ "EAdd. Exp ::= Exp \"+\" Exp1  ;"
+          , "ESub. Exp ::= Exp \"-\" Exp1  ;"
+          , "EMul. Exp1  ::= Exp1  \"*\" Exp2  ;"
+          , "EDiv. Exp1  ::= Exp1  \"/\" Exp2  ;"
+          , "EInt. Exp2  ::= Integer ;"
+          , "coercions Exp 2 ;" ]
+
+spec = do
+  describe "Java backend" $
+    it "respect the makefile option" $ do
+      calc <- getCalc
+      let opts = calcOptions { make = Just "MyMakefile" }
+      makeJava opts calc `shouldGenerate` "MyMakefile"
diff --git a/test/BNFC/Backend/LatexSpec.hs b/test/BNFC/Backend/LatexSpec.hs
new file mode 100644
--- /dev/null
+++ b/test/BNFC/Backend/LatexSpec.hs
@@ -0,0 +1,34 @@
+module BNFC.Backend.LatexSpec where
+
+import BNFC.Options
+import BNFC.GetCF
+
+import Test.Hspec
+import BNFC.Hspec
+
+import BNFC.Backend.Latex -- SUT
+
+calcOptions = defaultOptions { lang = "Calc" }
+getCalc = parseCF  calcOptions TargetLatex $
+  unlines [ "EAdd. Exp ::= Exp \"+\" Exp1  ;"
+          , "ESub. Exp ::= Exp \"-\" Exp1  ;"
+          , "EMul. Exp1  ::= Exp1  \"*\" Exp2  ;"
+          , "EDiv. Exp1  ::= Exp1  \"/\" Exp2  ;"
+          , "EInt. Exp2  ::= Integer ;"
+          , "coercions Exp 2 ;" ]
+
+spec = do
+
+  describe "LaTeX backend" $ do
+    it "creates the .tex file" $ do
+      calc <- getCalc
+      makeLatex calcOptions calc `shouldGenerate` "Calc.tex"
+
+    it "creates the Makefile" $ do
+      calc <- getCalc
+      let options = calcOptions { make = Just "Makefile" }
+      makeLatex options calc `shouldGenerate` "Makefile"
+
+  describe "prt" $ do
+    it "correctly converts ^^ into latex \textasciicircum\textasciicircum" $
+      prt "^^" `shouldBe` "{\\textasciicircum}{\\textasciicircum}"
diff --git a/test/BNFC/Backend/OCamlSpec.hs b/test/BNFC/Backend/OCamlSpec.hs
new file mode 100644
--- /dev/null
+++ b/test/BNFC/Backend/OCamlSpec.hs
@@ -0,0 +1,26 @@
+module BNFC.Backend.OCamlSpec where
+
+import BNFC.Options
+import BNFC.GetCF
+
+import Test.Hspec
+import BNFC.Hspec
+
+import BNFC.Backend.OCaml -- SUT
+
+calcOptions = defaultOptions { lang = "Calc" }
+getCalc = parseCF  calcOptions TargetHaskell $
+  unlines [ "EAdd. Exp ::= Exp \"+\" Exp1  ;"
+          , "ESub. Exp ::= Exp \"-\" Exp1  ;"
+          , "EMul. Exp1  ::= Exp1  \"*\" Exp2  ;"
+          , "EDiv. Exp1  ::= Exp1  \"/\" Exp2  ;"
+          , "EInt. Exp2  ::= Integer ;"
+          , "coercions Exp 2 ;" ]
+
+spec =
+  describe "OCaml backend" $
+    it "respect the makefile option" $ do
+      calc <- getCalc
+      let opts = calcOptions { make = Just "MyMakefile" }
+      makeOCaml opts calc `shouldGenerate` "MyMakefile"
+
diff --git a/test/BNFC/CFSpec.hs b/test/BNFC/CFSpec.hs
new file mode 100644
--- /dev/null
+++ b/test/BNFC/CFSpec.hs
@@ -0,0 +1,74 @@
+module BNFC.CFSpec where
+
+import Test.Hspec
+
+-- SUT:
+import BNFC.CF
+
+spec :: Spec
+spec = do
+  describe "Show Cat" $ do
+    it "shows (Cat \"Def\") as \"Def\"" $
+        show (Cat "Def") `shouldBe` "Def"
+    it "shows (ListCat (Cat \"Thing\")) as \"[Thing]\"" $
+        show (ListCat (Cat "Thing")) `shouldBe` "[Thing]"
+    it "shows (CoercCat \"Expr\" 3) as \"Expr3\"" $
+        show (CoercCat "Expr" 3) `shouldBe` "Expr3"
+    it "shows (ListCat (CoercCat \"Expr\" 2)) as \"[Expr2]\"" $
+        show (ListCat (CoercCat "Expr" 2)) `shouldBe` "[Expr2]"
+    it "shows (TokenCat \"Abc\") as \"Abc\"" $
+        show (TokenCat "Abc") `shouldBe` "Abc"
+
+  describe "strToCat" $ do
+    it "reads \"Abc\" to Cat \"Abc\"" $
+        strToCat "Abc" `shouldBe` Cat "Abc"
+    it "reads \"Abc123\" to CoercCat \"Abc\" 123" $
+        strToCat "Abc123" `shouldBe` CoercCat "Abc" 123
+    it "reads \"[Expr2]\" to ListCat (CoercCat \"Expr\" 2)" $
+        strToCat "[Expr2]" `shouldBe` ListCat (CoercCat "Expr" 2)
+
+  describe "identCat" $ do
+    it "returns ListC for (ListCat (Cat \"C\"))" $
+        identCat (ListCat (Cat "C")) `shouldBe` "ListC"
+    it "returns C3 for (CoercCat \"C\" 3)" $
+        identCat (CoercCat "C" 3) `shouldBe` "C3"
+
+  describe "catOfList" $ do
+    it "returns Cat \"A\" for (ListCat (Cat \"A\"))" $
+        catOfList (ListCat (Cat "A")) `shouldBe` Cat "A"
+    it "returns Cat \"B\" for (Cat \"B\")" $
+        catOfList (Cat "B") `shouldBe` Cat "B"
+
+  describe "precCat" $ do
+    it "returns 0 for a regular category" $ do
+        precCat (Cat "Abc") `shouldBe` 0
+    it "returns the precedence of a CoercCat" $
+        precCat (CoercCat "Abc" 4) `shouldBe` 4
+    it "returns the precedence of a CoercCat inside of a ListCat" $
+        precCat (ListCat (CoercCat "Abc" 2)) `shouldBe` 2
+
+  describe "sameCat" $ do
+    it "considers a category to be the same as itself" $
+        sameCat (Cat "Abc") (Cat "Abc") `shouldBe` True
+    it "considers Abc3 and Abc5 to be the same" $
+        sameCat (CoercCat "Abc" 3) (CoercCat "Abc" 5) `shouldBe` True
+    it "considers Abc and Abc4 to be the same" $
+        sameCat (Cat "Abc") (CoercCat "Abc" 44) `shouldBe` True
+    it "considers Foo and Bar to not be the same" $
+        sameCat (Cat "Foo") (Cat "Bar") `shouldBe` False
+
+  describe "getSeparatorByPrecedence" $ do
+    let c0 = CoercCat "C" 0
+        c1 = CoercCat "C" 1
+        rule0 = Rule "(:)" (ListCat c0) [Left c0, Right ",", Left (ListCat c0)]
+        rule1 = Rule "(:)" (ListCat c1) [Left c1, Right ";", Left (ListCat c1)]
+
+    it "returns a single value for a simple list" $
+      getSeparatorByPrecedence [rule0] `shouldBe` [(0,",")]
+
+    it "returns as many separators as there are list constructors" $
+      getSeparatorByPrecedence [rule0, rule1] `shouldBe` [(1,";"),(0,",")]
+
+    it "ignores additional rules with the same precedence" $
+      getSeparatorByPrecedence [rule0, rule1, rule0] `shouldBe` [(1,";"),(0,",")]
+
diff --git a/test/BNFC/GetCFSpec.hs b/test/BNFC/GetCFSpec.hs
new file mode 100644
--- /dev/null
+++ b/test/BNFC/GetCFSpec.hs
@@ -0,0 +1,36 @@
+module BNFC.GetCFSpec where
+
+import Test.Hspec
+
+-- SUT:
+import BNFC.GetCF
+
+import BNFC.CF
+import qualified AbsBNF as Abs
+
+spec :: Spec
+spec = do
+  describe "transItem" $ do
+
+    it "translate a non-terminal" $
+        transItem (Abs.NTerminal (Abs.IdCat (Abs.Ident "Foo3")))
+            `shouldBe` [Left (CoercCat "Foo" 3)]
+
+    it "translate a terminal" $
+        transItem (Abs.Terminal "foobar") `shouldBe` [Right "foobar"]
+
+    it "skips empty terminals" $
+        transItem (Abs.Terminal "") `shouldBe` []
+
+    it "splits multiwords terminals" $
+        transItem (Abs.Terminal "foo bar") `shouldBe` [Right "foo", Right "bar"]
+
+  describe "checkRule" $ do
+
+    it "returns an error if the rule uses an unknown category" $ do
+        let rulep = Rule ("Foo", ("Foo", [])) (Cat "Bar") [Left (Cat "Baz")]
+            rule = Rule "Foo" (Cat "Bar") [Left (Cat "Baz")]
+            cf = CFG [] [] [] [] [] [rule]
+            expected =
+                "no production for Baz, appearing in rule\n    Foo. Bar ::= Baz"
+        checkRule cf rulep `shouldBe` Just expected
diff --git a/test/BNFC/Hspec.hs b/test/BNFC/Hspec.hs
new file mode 100644
--- /dev/null
+++ b/test/BNFC/Hspec.hs
@@ -0,0 +1,23 @@
+-- | Custom hspec expectations.
+
+module BNFC.Hspec where
+
+import Text.Printf
+
+import BNFC.Backend.Base
+
+import Test.Hspec
+import Test.HUnit ((@?))
+
+
+-- | Expectation that a backend generates a particular file.
+
+shouldGenerate
+  :: Backend   -- ^ Backend to run.
+  -> String    -- ^ Name of file that should be created during that run.
+  -> Expectation
+backend `shouldGenerate` file = do
+  files <- execBackend backend
+  let filenames = map fst files
+  file `elem` filenames
+    @? printf "file %s not found in %s" file (show filenames)
diff --git a/test/BNFC/WarningMSpec.hs b/test/BNFC/WarningMSpec.hs
--- a/test/BNFC/WarningMSpec.hs
+++ b/test/BNFC/WarningMSpec.hs
@@ -19,10 +19,10 @@
 
   describe "hasWarnings" $ do
 
-    it "returns true if the computation has warnings" $
+    it "returns True if the computation produces warnings" $
       hasWarnings computationWithWarnings `shouldBe` True
 
-    it "returns Fasle if the computation doesn't have any warnings" $
+    it "returns False if the computation does not produce any warnings" $
       hasWarnings (return ()) `shouldBe` False
 
   where computationWithWarnings = warn "Coucou" >> warn "Hi" >> return 3
diff --git a/test/doctests.hs b/test/doctests.hs
--- a/test/doctests.hs
+++ b/test/doctests.hs
@@ -1,8 +1,16 @@
 import Test.DocTest
+
 main = doctest
-    [ "-isrc"
+    [ "-icompat"
+    , "-isrc"
     , "-idist/build/autogen/"
     , "-idist/build/bnfc/bnfc-tmp"
+    , "-XLambdaCase"
+    , "-XFlexibleContexts"
     , "-XOverloadedStrings"
     , "-XRecordWildCards"
-    , "src/Main.hs" ]
+    , "-XScopedTypeVariables"
+    , "-XTupleSections"
+    , "src/PrintBNF.hs"
+    , "src/Main.hs"
+    ]
diff --git a/test/unit-tests.hs b/test/unit-tests.hs
--- a/test/unit-tests.hs
+++ b/test/unit-tests.hs
@@ -1,1 +1,20 @@
 {-# OPTIONS_GHC -F -pgmF hspec-discover #-}
+
+-- This file is intentionally left blank.
+
+-- See http://hspec.github.io/hspec-discover.html
+--
+-- This instructs GHC to invoke hspec-discover as a preprocessor on the
+-- source file. The rest of the source file is empty, so there is nothing
+-- to preprocess. Rather than preprocessing, hspec-discover scans the
+-- file system for all spec files belonging to a project and generates
+-- the required boilerplate. hspec-discover does not parse any source
+-- files, it instead relies on the following conventions:
+--
+--   * Spec files have to be placed into the same directory as the test
+--     driver, or into a subdirectory.
+--
+--   * The name of a spec file has to end in Spec.hs; the module name has
+--     to match the file name.
+--
+--   * Each spec file has to export a top-level binding spec of type Spec.
