Module CPP.ICode.Parser.SQL.Converter

This module implements the Interface for the CurryPP Translator. To provide the tranformation of SQL-statements it calls in this order: Scanner Parser Consistency check Type check Translator (to functions of CDBI interface) Reads the .info file which contains information about the data model and passes the information to the corresponding subroutines. Aborts compilation process in case a stage returns with an error.

Author: Julia Krone

Summary of exported operations:

parseSQL :: Bool -> Either String ParserInfo -> Pos -> String -> IO (PM String)  Deterministic 
Converts a string representing SQL-requests into functions defined in the CDBI interface by calling the different stage of transformation.
readParserInfo :: Int -> String -> IO (Either String ParserInfo)  Deterministic 
Reader for parser information file.

Exported operations:

parseSQL :: Bool -> Either String ParserInfo -> Pos -> String -> IO (PM String)  Deterministic 

Converts a string representing SQL-requests into functions defined in the CDBI interface by calling the different stage of transformation.

Example call:
(parseSQL withrundb parserInfo pos code)
Parameters:
  • withrundb : decorate target code with runWithDB
  • parserInfo : either the parser information or an error message
  • pos : Position of the integrated SQL-String in the orginal file
  • code : the SQL-request as string
Returns:
A String in Curry-Syntax (CDBI-functions).

readParserInfo :: Int -> String -> IO (Either String ParserInfo)  Deterministic 

Reader for parser information file.

Example call:
(readParserInfo verb filename)
Parameters:
  • verb : verbosity level
  • filename : path/name of the .info file
Returns:
either an error message or the parser information