HORIZON HASKELLDocslts/ghc-10.0.x8fef28d2026-11-02Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8fef28d · 2026-11-02

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.

Contents
  1. Input stream
  2. Identifiers
  3. Unqiue names
  4. Source code positions
  5. Syntax tree nodes
  6. Extensible errors
Synopsis

Input stream

Identifiers

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

newtypenewtype Name

Name is a unique identifier

Constructors

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

Source code positions

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.

classclass Pos a where

class of type which aggregate a source code location

Methods

Instances48Pos, …

Syntax tree nodes

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, …

Extensible errors