CSPM-Frontend-0.3.0.4: A CSP-M parser compatible with FDR-2.83

PortabilityGHC-only
Stabilityexperimental
MaintainerFontaine@cs.uni-duesseldorf.de

Language.CSPM.AstUtils

Description

Some utility functions for converting the AST

Synopsis

Documentation

removeSourceLocations :: LModule -> LModuleSource

removeSourceLocations sets all locationsInfos to NoLocation

removeParens :: LModule -> LModuleSource

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

removeModuleTokens :: LModule -> LModuleSource

set the tokenlist in the module datatype to Nothing

unUniqueIdent :: LModule -> LModuleSource

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

relabelAst :: NodeId -> LModule -> LModuleSource

relabelAst compute an AST with new NodeIds starting with the given NodeId

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.