CSPM-Frontend- A CSP-M parser compatible with FDR-2.91

Safe HaskellSafe-Infered



Frontend contains some reexports from other modules



parse :: SourceName -> [Token] -> Either ParseError ModuleFromParserSource

The parse function parses a List of Token. It returns a ParseError or a Labled Module. The SourceName argument is currently not used.

data ParseError Source

ParseError data type. This is an instance of Excpetion

parseFile :: FilePath -> IO ModuleFromParserSource

Lex and parse a file and return a LModule, throw an exception in case of an error

benchmarkFrontend :: FilePath -> IO (ModuleFromParser, ModuleFromRenaming)Source

Lex and parse File. | Return the module and print some timing infos

eitherToExc :: Exception a => Either a b -> IO bSource

eitherToExe returns the Right part of Either or throws the Left part as an dynamic exception.

handleLexError :: (LexError -> IO a) -> IO a -> IO aSource

Handle a dymanic exception of type LexError.

handleParseError :: (ParseError -> IO a) -> IO a -> IO aSource

Handle a dymanic exception of type ParseError.

handleRenameError :: (RenameError -> IO a) -> IO a -> IO aSource

Handle a dymanic exception of type RenameError.

lexInclude :: String -> IO (Either LexError [Token])Source

lex a String and process CSP-M include statements.

lexPlain :: String -> Either LexError [Token]Source

lex a String .

removeIgnoredToken :: [Token] -> [Token]Source

Remove comments, whitespaces and unneeded newlines.

data Module a Source


type ModuleFromRenaming = Module FromRenamingSource

A module that has gone through renaming

data Labeled t Source




nodeId :: NodeId
srcLoc :: SrcLoc
unLabel :: t


Typeable1 Labeled 
Eq t => Eq (Labeled t) 
Data t => Data (Labeled t) 
Ord t => Ord (Labeled t) 
Show t => Show (Labeled t) 
Generic (Labeled t) 
Pretty x => Pretty (Labeled x) 

removeSourceLocations :: Data a => a -> aSource

removeSourceLocations sets all locationsInfos to NoLocation

removeParens :: Data a => a -> aSource

removeParens removes all occurences of of Parens, i.e. explicit parentheses from the AST

unUniqueIdent :: Data a => a -> aSource

unUniqueIdent replaces the all UIdent with the Ident of the the new name, thus forgetting additional information like the bindingside, etc. Usefull to get a smaller AST.

computeFreeNames :: Data a => a -> FreeNamesSource

Compute the FreeNames of an Expression. This function does only work after renaming has been done. This implementation is inefficient.

setNodeIdsZero :: Data a => a -> aSource

Set all NodeIds to zero.

frontendVersion :: VersionSource

The version of the CSPM-Frontend library