HORIZON HASKELLDocslts/ghc-9.14.x45dd5372026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · 45dd537 · 2026-10-11

Modulelanguage-c-0.10.2Haskell2010

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

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, …
valueposColumn :: Position -> Int
#

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

valueposRow :: Position -> Int
#

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

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