| |||||||||||||
| |||||||||||||
| |||||||||||||
| Description | |||||||||||||
| Synopsis | |||||||||||||
| Documentation | |||||||||||||
| type GlobalDeclarations = FiniteMap (ClassName, MemberName) TypeName | |||||||||||||
| A repository of variable declarations at a certain point Maybe TypeName -> The class where the variable is declared (Nothing if al local scope) VarName -> The fieldvariable being declared TypeName -> The type of the variablefield | |||||||||||||
| type LocalDeclarations = FiniteMap VarName TypeName | |||||||||||||
| type Declarations = (GlobalDeclarations, LocalDeclarations) | |||||||||||||
| type TypeName = String | |||||||||||||
| The type of a class in a declaration type TypeName = String | |||||||||||||
| type ClassName = String | |||||||||||||
| type VarName = String | |||||||||||||
| The name of a variable | |||||||||||||
| type MethodName = String | |||||||||||||
| The name of a method | |||||||||||||
| type ParameterType = TypeName | |||||||||||||
| The type of a parameter in the method header | |||||||||||||
| data MemberName | |||||||||||||
| |||||||||||||
| Declarations API | |||||||||||||
| emptyDec :: Declarations | |||||||||||||
| Empty declaration | |||||||||||||
| appendDec :: Declarations -> Declarations -> Declarations | |||||||||||||
| Append two declarations | |||||||||||||
| addGlobalDec :: Declarations -> (ClassName, MemberName) -> TypeName -> Declarations | |||||||||||||
| Add a global declararion | |||||||||||||
| addLocalDec :: Declarations -> VarName -> TypeName -> Declarations | |||||||||||||
| Add a local declararion | |||||||||||||
| getLocalType :: MonadPlus m => Declarations -> VarName -> m TypeName | |||||||||||||
| Get the type of a local variable | |||||||||||||
| getGlobalType :: MonadPlus m => Declarations -> ClassName -> MemberName -> m TypeName | |||||||||||||
| Get the type of a global (class scope) member (Field or Method) | |||||||||||||
| getType :: MonadPlus m => Declarations -> ClassName -> MemberName -> m TypeName | |||||||||||||
| General funcion for getting a variable's or member's type | |||||||||||||
| Declarations Manipulation | |||||||||||||
| collectMembers :: (Term a, MonadPlus m) => ClassName -> a -> m Declarations | |||||||||||||
| Generic function to collect global variable declarations | |||||||||||||
| getLocalDecls :: (Term a, MonadPlus m) => a -> m Declarations | |||||||||||||
| Collects local variable declarations in a method | |||||||||||||
| getVars :: (Term a, MonadPlus m) => a -> m [MemberName] | |||||||||||||
| Collect a local variable | |||||||||||||
| getMethodParameters :: (Term a, MonadPlus m) => a -> m [FormalParameter] | |||||||||||||
| Get parameter list from a term. Must be applied to a method declaration, otherwise, erroneous results mus be expected | |||||||||||||
| Produced by Haddock version 0.6 |