Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- cf2flex :: ParserMode -> CF -> (String, SymMap)
- data ParserMode
- parserName :: ParserMode -> String
- parserPackage :: ParserMode -> InPackage
- cParser :: ParserMode -> Bool
- stlParser :: ParserMode -> Bool
- parserHExt :: ParserMode -> String
- preludeForBuffer :: String -> [String]
- cMacros :: CF -> String
- commentStates :: [String]
- lexComments :: ([(String, String)], [String]) -> Doc
- lexStrings :: String -> String -> String -> [String]
- lexChars :: String -> String -> [String]
Documentation
data ParserMode Source #
parserName :: ParserMode -> String Source #
parserPackage :: ParserMode -> InPackage Source #
cParser :: ParserMode -> Bool Source #
stlParser :: ParserMode -> Bool Source #
parserHExt :: ParserMode -> String Source #
preludeForBuffer :: String -> [String] Source #
Part of the lexer prelude needed when string literals are to be lexed. Defines an interface to the Buffer.
commentStates :: [String] Source #
If we have several block comments, we need different COMMENT lexing states.
lexComments :: ([(String, String)], [String]) -> Doc Source #
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 ([("{-","-}")],["--"])
<INITIAL>"--"[^\n]* /* skip */; /* BNFC: comment "--" */ <INITIAL>"{-" BEGIN COMMENT; /* BNFC: block comment "{-" "-}" */ <COMMENT>"-}" BEGIN INITIAL; <COMMENT>. /* skip */; <COMMENT>[\n] /* skip */;