Portability | GHC-only |
---|---|
Stability | experimental |
Maintainer | Fontaine@cs.uni-duesseldorf.de |
This Module defines an Abstract Syntax Tree for CSPM. This is the AST that is computed by the parser. For historycal reasons, it is rather unstructured
- type AstAnnotation x = IntMap x
- type Bindings = Map String UniqueIdent
- type FreeNames = IntMap UniqueIdent
- newtype NodeId = NodeId {}
- mkNodeId :: Int -> NodeId
- data Labeled t = Labeled {}
- labeled :: t -> Labeled t
- setNode :: Labeled t -> y -> Labeled y
- type LIdent = Labeled Ident
- data Ident
- identId :: LIdent -> Int
- data UniqueIdent = UniqueIdent {
- uniqueIdentId :: Int
- bindingSide :: NodeId
- bindingLoc :: SrcLoc
- idType :: IDType
- realName :: String
- newName :: String
- prologMode :: PrologMode
- bindType :: BindType
- data IDType
- = VarID
- | ChannelID
- | NameTypeID
- | FunID Int
- | ConstrID String
- | DataTypeID
- | TransparentID
- data BindType
- = LetBound
- | NotLetBound
- isLetBound :: BindType -> Bool
- data PrologMode
- type LModule = Labeled Module
- data Module = Module {
- moduleDecls :: [LDecl]
- moduleTokens :: Maybe [Token]
- type LProc = LExp
- type LExp = Labeled Exp
- data Exp
- = Var LIdent
- | IntExp Integer
- | SetEnum [LExp]
- | ListEnum [LExp]
- | SetOpen LExp
- | ListOpen LExp
- | SetClose (LExp, LExp)
- | ListClose (LExp, LExp)
- | SetComprehension ([LExp], [LCompGen])
- | ListComprehension ([LExp], [LCompGen])
- | ClosureComprehension ([LExp], [LCompGen])
- | Let [LDecl] LExp
- | Ifte LExp LExp LExp
- | CallFunction LExp [[LExp]]
- | CallBuiltIn LBuiltIn [[LExp]]
- | Lambda [LPattern] LExp
- | Stop
- | Skip
- | CTrue
- | CFalse
- | Events
- | BoolSet
- | IntSet
- | TupleExp [LExp]
- | Parens LExp
- | AndExp LExp LExp
- | OrExp LExp LExp
- | NotExp LExp
- | NegExp LExp
- | Fun1 LBuiltIn LExp
- | Fun2 LBuiltIn LExp LExp
- | DotTuple [LExp]
- | Closure [LExp]
- | ProcSharing LExp LProc LProc
- | ProcAParallel LExp LExp LProc LProc
- | ProcLinkParallel LLinkList LProc LProc
- | ProcRenaming [LRename] (Maybe LCompGenList) LProc
- | ProcRepSequence LCompGenList LProc
- | ProcRepInternalChoice LCompGenList LProc
- | ProcRepExternalChoice LCompGenList LProc
- | ProcRepInterleave LCompGenList LProc
- | ProcRepAParallel LCompGenList LExp LProc
- | ProcRepLinkParallel LCompGenList LLinkList LProc
- | ProcRepSharing LCompGenList LExp LProc
- | PrefixExp LExp [LCommField] LProc
- | PrefixI FreeNames LExp [LCommField] LProc
- | LetI [LDecl] FreeNames LExp
- | LambdaI FreeNames [LPattern] LExp
- | ExprWithFreeNames FreeNames LExp
- type LCompGenList = Labeled [LCompGen]
- type LCommField = Labeled CommField
- data CommField
- type LLinkList = Labeled LinkList
- data LinkList
- = LinkList [LLink]
- | LinkListComprehension [LCompGen] [LLink]
- type LLink = Labeled Link
- data Link = Link LExp LExp
- type LRename = Labeled Rename
- data Rename = Rename LExp LExp
- type LBuiltIn = Labeled BuiltIn
- data BuiltIn = BuiltIn Const
- lBuiltInToConst :: LBuiltIn -> Const
- type LCompGen = Labeled CompGen
- data CompGen
- type LPattern = Labeled Pattern
- data Pattern
- data Selector
- = IntSel Integer
- | TrueSel
- | FalseSel
- | SelectThis
- | ConstrSel UniqueIdent
- | DotSel Int Selector
- | SingleSetSel Selector
- | EmptySetSel
- | TupleLengthSel Int Selector
- | TupleIthSel Int Selector
- | ListLengthSel Int Selector
- | ListIthSel Int Selector
- | HeadSel Selector
- | HeadNSel Int Selector
- | PrefixSel Int Int Selector
- | TailSel Selector
- | SliceSel Int Int Selector
- | SuffixSel Int Int Selector
- type LDecl = Labeled Decl
- data Decl
- type FunArgs = [[LPattern]]
- data FunCase
- type LTypeDef = Labeled TypeDef
- data TypeDef
- type LConstructor = Labeled Constructor
- data Constructor = Constructor LIdent (Maybe LTypeDef)
- withLabel :: (NodeId -> a -> b) -> Labeled a -> Labeled b
- mkLabeledNode :: NodeIdSupply m => SrcLoc -> t -> m (Labeled t)
- class Monad m => NodeIdSupply m where
- getNewNodeId :: m NodeId
- data Const
- = F_true
- | F_false
- | F_not
- | F_and
- | F_or
- | F_union
- | F_inter
- | F_diff
- | F_Union
- | F_Inter
- | F_member
- | F_card
- | F_empty
- | F_set
- | F_Set
- | F_Seq
- | F_null
- | F_head
- | F_tail
- | F_concat
- | F_elem
- | F_length
- | F_STOP
- | F_SKIP
- | F_Events
- | F_Int
- | F_Bool
- | F_CHAOS
- | F_Concat
- | F_Len2
- | F_Mult
- | F_Div
- | F_Mod
- | F_Add
- | F_Sub
- | F_Eq
- | F_NEq
- | F_GE
- | F_LE
- | F_LT
- | F_GT
- | F_Guard
- | F_Sequential
- | F_Interrupt
- | F_ExtChoice
- | F_IntChoice
- | F_Hiding
- | F_Timeout
- | F_Interleave
Documentation
type AstAnnotation x = IntMap xSource
type Bindings = Map String UniqueIdentSource
type FreeNames = IntMap UniqueIdentSource
labeled :: t -> Labeled tSource
Wrap a node with a dummyLabel | todo: redo we need a specal case in DataConstructor Labeled | also rename to unLabeled
data UniqueIdent Source
UniqueIdent | |
|
isLetBound :: BindType -> BoolSource
data PrologMode Source
Module | |
|
type LCompGenList = Labeled [LCompGen]Source
type LCommField = Labeled CommFieldSource
type LConstructor = Labeled ConstructorSource
data Constructor Source
mkLabeledNode :: NodeIdSupply m => SrcLoc -> t -> m (Labeled t)Source
class Monad m => NodeIdSupply m whereSource
getNewNodeId :: m NodeIdSource