HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulelanguage-c-0.9.3Haskell2010

Language.C.Data

Common data types for Language.C: Identifiers, unique names, source code locations, ast node attributes and extensible errors.

  • 5 types
  • 2 classes
  • 27 values
  • Packagelanguage-c-0.9.3
  • Exports34
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceData.hs

Input stream

0 declarations

Identifiers

9 declarations
datadata SUERef
#

References uniquely determining a struct, union or enum type. Those are either identified by an string identifier, or by a unique name (anonymous types).

Instances8Eq, Data, Ord, Show, Generic, NFData, …
datadata Ident
#

C identifiers

Instances10Eq, Data, Ord, Show, Generic, NFData, …
valuemkIdent :: Position -> String -> Name -> Ident
#

build an identifier from a string.

  • only minimal error checking, e.g., the characters of the identifier are not checked for being alphanumerical only; the correct lexis of the identifier should be ensured by the caller, e.g., the scanner.

  • for reasons of simplicity the complete lexeme is hashed.

Unqiue names

2 declarations
newtypenewtype Name
#

Name is a unique identifier

Constructors

Instances10Enum, Eq, Data, Ord, Read, Show, …

Source code positions

14 declarations
datadata Position
#

uniform representation of source file positions

Instances7Eq, Data, Ord, Show, Generic, NFData, …
valueposRow :: Position -> Int
#

row (line) in the original file. Affected by #LINE pragmas.

valueposColumn :: Position -> Int
#

column in the preprocessed file. Inaccurate w.r.t. to the original file in the presence of preprocessor macros.

classclass Pos a where
#

class of type which aggregate a source code location

Methods

Instances48Pos, …
valueinitPos :: FilePath -> Position
#

initialize a Position to the start of the translation unit starting in the given file

valuenopos :: Position
#

no position (for unknown position information)

Syntax tree nodes

9 declarations
datadata NodeInfo
#

Parsed entity attribute

Instances34Eq, Data, Ord, Show, Generic, NFData, …
classclass CNode a where
#

a class for convenient access to the attributes of an attributed object

Methods

Instances46CNode, …
valueundefNode :: NodeInfo
#

create a node with neither name nor positional information

Extensible errors

0 declarations