ogma-language-csv-1.14.0: Ogma: Runtime Monitor translator: CSV Frontend

Safe Haskell | None
Language | Haskell2010

Language.CSVSpec.Parser

Description

Parser for Ogma specs stored in CSV files.

Synopsis

- data CSVFormat = CSVFormat {
  - skipHeaders :: Bool
  - specRequirementId :: Int
  - specRequirementDesc :: Maybe Int
  - specRequirementExpr :: Int
  - specRequirementResultType :: Maybe Int
  - specRequirementResultExpr :: Maybe Int
  }
- parseCSVSpec :: (String -> IO (Either String a)) -> a -> CSVFormat -> String -> IO (Either String (Spec a))

# Documentation

data CSVFormat Source #

Area of the CSV file that contains the information of interest.

Constructors

CSVFormat |

Fields

- skipHeaders :: Bool
- specRequirementId :: Int
- specRequirementDesc :: Maybe Int
- specRequirementExpr :: Int
- specRequirementResultType :: Maybe Int
- specRequirementResultExpr :: Maybe Int

#### Instances

Instances details

Read CSVFormat Source # |
Instance details Defined in Language.CSVSpec.Parser Methods readsPrec :: Int -> ReadS CSVFormat Source # readList :: ReadS [CSVFormat] Source # readPrec :: ReadPrec CSVFormat Source # readListPrec :: ReadPrec [CSVFormat] Source #
Show CSVFormat Source # |
Instance details Defined in Language.CSVSpec.Parser Methods showsPrec :: Int -> CSVFormat -> ShowS Source # show :: CSVFormat -> String Source # showList :: [CSVFormat] -> ShowS Source #

parseCSVSpec Source #

Arguments

:: (String -> IO (Either String a)) | Parser for expressions.
-> a | Default property value.
-> CSVFormat | CSV file format spec.
-> String | String containing CSV.
-> IO (Either String (Spec a)) |

Parse a CSV file and extract a Spec from it.

An auxiliary function must be provided to parse the requirement expressions.

Fails if any of the columns indicate a column out of range, of if the CSV is malformed.