Community
Modules 25

Text.ParserCombinators.Parsec.Language

provisional

Parsec compatibility module

haskellDef :: LanguageDef st

The language definition for the Haskell language.

haskell :: TokenParser st

A lexer for the Haskell language.

mondrianDef :: LanguageDef st

The language definition for the language Mondrian.

mondrian :: TokenParser st

A lexer for the Mondrian language.

emptyDef :: LanguageDef st

This is the most minimal token definition. It is recommended to use this definition as the basis for other definitions. emptyDef has no reserved names or operators, is case sensitive and doesn't accept comments, identifiers or operators.

haskellStyle :: LanguageDef st

This is a minimal token definition for Haskell style languages. It defines the style of comments, valid identifiers and case sensitivity. It does not define any reserved words or operators.

javaStyle :: LanguageDef st

This is a minimal token definition for Java style languages. It defines the style of comments, valid identifiers and case sensitivity. It does not define any reserved words or operators.

type LanguageDef st = GenLanguageDef String st Identity

data GenLanguageDef s u m

The GenLanguageDef type is a record that contains all parameterizable features of the Text.Parsec.Token module. The module Text.Parsec.Language contains some default definitions.

LanguageDef :: String -> String -> String -> Bool -> ParsecT s u m Char -> ParsecT s u m Char -> ParsecT s u m Char -> ParsecT s u m Char -> [String] -> [String] -> Bool -> GenLanguageDef s u m

commentStart :: GenLanguageDef s u m -> String

Describes the start of a block comment. Use the empty string if the language doesn't support block comments. For example "/*".

commentEnd :: GenLanguageDef s u m -> String

Describes the end of a block comment. Use the empty string if the language doesn't support block comments. For example "*/".

commentLine :: GenLanguageDef s u m -> String

Describes the start of a line comment. Use the empty string if the language doesn't support line comments. For example "//".

nestedComments :: GenLanguageDef s u m -> Bool

Set to True if the language supports nested block comments.

identStart :: GenLanguageDef s u m -> ParsecT s u m Char

This parser should accept any start characters of identifiers. For example letter <|> char '_'.

identLetter :: GenLanguageDef s u m -> ParsecT s u m Char

This parser should accept any legal tail characters of identifiers. For example alphaNum <|> char '_'.

opStart :: GenLanguageDef s u m -> ParsecT s u m Char

This parser should accept any start characters of operators. For example oneOf ":!#$%&*+./<=>?\\\^|-~"@

opLetter :: GenLanguageDef s u m -> ParsecT s u m Char

This parser should accept any legal tail characters of operators. Note that this parser should even be defined if the language doesn't support user-defined operators, or otherwise the reservedOp parser won't work correctly.

reservedNames :: GenLanguageDef s u m -> [String]

The list of reserved identifiers.

reservedOpNames :: GenLanguageDef s u m -> [String]

The list of reserved operators.

caseSensitive :: GenLanguageDef s u m -> Bool

Set to True if the language is case sensitive.

Maintainer
derek.a.elkins@gmail.com
Portability
portable
Copyright
(c) Paolo Martini 2007
License
BSD-style (see the LICENSE file)
Build record and source files

Community contribution. The service has not verified this documentation. The generator reported 3 diagnostics.

Target: Linux on x86-64. Some inferred types and resolved links are not available.

Generator: aihc-haddock-858b1951-web-1

Metadata snapshot: 51a8c38adf37e9558e7835b04b20868626c044e2d2e98e3527943eabd1e09c0a

Open the dependency plan · Download the documentation model

Import a package

Enter a package name and an exact version from Hackage. The site contains imported versions only.