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




Some utility functions for converting the AST



removeSourceLocations :: Data a => Labeled (Module a) -> Labeled (Module a)Source

removeSourceLocations sets all locationsInfos to NoLocation

removeParens :: Data a => Labeled (Module a) -> Labeled (Module a)Source

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

removeModuleTokens :: Labeled (Module a) -> Labeled (Module a)Source

set the tokenlist in the module datatype to Nothing

unUniqueIdent :: Data a => Labeled (Module a) -> Labeled (Module a)Source

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.

showAst :: Data a => Labeled a -> StringSource

'a show function that omits the node labeles. | TODO : fix this is very buggy. | this does not work for Compiles pattern / Arrays

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.

getModuleAsserts :: Module a -> [LAssertDecl]Source

Get the assert declarations of a module

setNodeIdsZero :: Data a => Labeled (Module a) -> Labeled (Module a)Source

Set all NodeIds to zero.