HORIZON HASKELLDocslts/ghc-10.0.x8fef28d2026-11-02Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8fef28d · 2026-11-02

ModuleBNFC-2.9.6.3Haskell2010

BNFC.Backend.C.CFtoFlexC

Synopsis
  • PackageBNFC-2.9.6.3
  • Exports13
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceCFtoFlexC.hs
valuelexComments :: ([(String, String)], [String]) -> Doc

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.

Example1 expression
lexComments ([("{-","-}")],["--"])<INITIAL>"--"[^\n]* /* skip */; /* BNFC: comment "--" */<INITIAL>"{-" BEGIN COMMENT; /* BNFC: block comment "{-" "-}" */<COMMENT>"-}" BEGIN INITIAL;<COMMENT>.    /* skip */;<COMMENT>[\n] /* skip */;