All ordinary identifiers map to IdenTyDecl: either a typedef or a object/function/enumerator
Modulelanguage-c-0.9.3Haskell2010
Language.C.Analysis.DefTable
This module manages symbols in local and global scopes.
There are four different kind of identifiers: ordinary identifiers (henceforth
simply called identifier), tag names (names of struct/union/enum types),
labels and structure members.
- 5 types
- 26 values
- Packagelanguage-c-0.9.3
- Exports31
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceDefTable.hs
Tag names map to forward declarations or definitions of struct/union/enum types
Constructors
Instances3CNode, Pretty, HasSUERef
CNode TagFwdDeclDefined in language-c-0.9.3 · Language.C.Analysis.DefTablePretty TagFwdDeclDefined in language-c-0.9.3 · Language.C.Analysis.Debug · orphanHasSUERef TagFwdDeclDefined in language-c-0.9.3 · Language.C.Analysis.DefTable
Table holding current definitions
Constructors
DefTableidentDecls :: NameSpaceMap Ident IdentEntrydeclared `ordinary identifiers'
tagDecls :: NameSpaceMap SUERef TagEntrydeclared structunionenum tags
labelDefs :: NameSpaceMap Ident Identdefined labels
memberDecls :: NameSpaceMap Ident MemberDeclmember declarations (only local)
refTable :: IntMap Namelink names with definitions
typeTable :: IntMap Type
empty definition table, with all name space maps in global scope
get the globally defined entries of a definition table
Enter function scope (AND the corresponding block scope)
Leave function scope, and return the associated DefTable. Error if not in function scope.
Enter new block scope
Leave innermost block scope
Enter new member declaration scope
Leave innermost member declaration scope
Status of a declaration
Constructors
NewDeclnew entry
Redeclared told def was overwritten
KeepDef tnew def was discarded
Shadowed tnew def shadows one in outer scope
KindMismatch tkind mismatch
Instances1Data
Data t => Data (DeclarationStatus t)Defined in language-c-0.9.3 · Language.C.Analysis.DefTable
declare/define a global object/function/typeDef
returns Redeclared def if there is already an object/function/typeDef
in global scope, or DifferentKindRedec def if the old declaration is of a different kind.
declare/define a object/function/typeDef with lexical scope
returns Redeclared def or DifferentKindRedec def if there is already an object/function/typeDef
in the same scope.
declare/define a object/function/typeDef with lexical scope, if the given predicate holds on the old entry.
returns Keep old_def if the old definition shouldn't be overwritten, and otherwise Redeclared def or
DifferentKindRedecl def if there is already an object/function/typeDef in the same scope.
declare a tag (fwd decl in case the struct name isn't defined yet)
define a tag
define a label Return the old label if it is already defined in this function's scope
lookup identifier (object, function, typeDef, enumerator)
lookup tag
lookup label
lookup an object in the innermost scope
lookup an identifier in the innermost scope
Record the type of a node.
Lookup the type of a node.
Merge two DefTables. If both tables contain an entry for a given key, they must agree on its value.