language-c-0.9.4: Analysis and generation of C code
Copyright(c) [1995..1999] Manuel M. T. Chakravarty
(c) 2008 Benedikt Huber (stripped radically)
LicenseBSD-style
Maintainerbenedikt.huber@gmail.com
Stabilityexperimental
Portabilityghc
Safe HaskellSafe-Inferred
LanguageHaskell2010

Language.C.Data.Node

Description

source position and unqiue name

Synopsis

Documentation

data NodeInfo Source #

Parsed entity attribute

Instances

Instances details
Data NodeInfo Source # 
Instance details

Defined in Language.C.Data.Node

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> NodeInfo -> c NodeInfo #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c NodeInfo #

toConstr :: NodeInfo -> Constr #

dataTypeOf :: NodeInfo -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c NodeInfo) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c NodeInfo) #

gmapT :: (forall b. Data b => b -> b) -> NodeInfo -> NodeInfo #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> NodeInfo -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> NodeInfo -> r #

gmapQ :: (forall d. Data d => d -> u) -> NodeInfo -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> NodeInfo -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> NodeInfo -> m NodeInfo #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> NodeInfo -> m NodeInfo #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> NodeInfo -> m NodeInfo #

Generic NodeInfo Source # 
Instance details

Defined in Language.C.Data.Node

Associated Types

type Rep NodeInfo :: Type -> Type #

Methods

from :: NodeInfo -> Rep NodeInfo x #

to :: Rep NodeInfo x -> NodeInfo #

Show NodeInfo Source # 
Instance details

Defined in Language.C.Data.Node

NFData NodeInfo Source # 
Instance details

Defined in Language.C.Data.Node

Methods

rnf :: NodeInfo -> () #

Eq NodeInfo Source # 
Instance details

Defined in Language.C.Data.Node

Ord NodeInfo Source # 
Instance details

Defined in Language.C.Data.Node

CNode NodeInfo Source # 
Instance details

Defined in Language.C.Data.Node

Pos NodeInfo Source # 
Instance details

Defined in Language.C.Data.Node

Pretty CAlignSpec Source # 
Instance details

Defined in Language.C.Pretty

Pretty CArrSize Source # 
Instance details

Defined in Language.C.Pretty

Pretty CAsmOperand Source # 
Instance details

Defined in Language.C.Pretty

Pretty CAsmStmt Source # 
Instance details

Defined in Language.C.Pretty

Pretty CAttr Source # 
Instance details

Defined in Language.C.Pretty

Pretty CBlockItem Source # 
Instance details

Defined in Language.C.Pretty

Pretty CBuiltin Source # 
Instance details

Defined in Language.C.Pretty

Pretty CConst Source # 
Instance details

Defined in Language.C.Pretty

Pretty CDecl Source # 
Instance details

Defined in Language.C.Pretty

Pretty CDeclSpec Source # 
Instance details

Defined in Language.C.Pretty

Pretty CDeclr Source # 
Instance details

Defined in Language.C.Pretty

Pretty CDesignator Source # 
Instance details

Defined in Language.C.Pretty

Pretty CEnum Source # 
Instance details

Defined in Language.C.Pretty

Pretty CExpr Source # 
Instance details

Defined in Language.C.Pretty

Pretty CExtDecl Source # 
Instance details

Defined in Language.C.Pretty

Pretty CFunDef Source # 
Instance details

Defined in Language.C.Pretty

Pretty CFunSpec Source # 
Instance details

Defined in Language.C.Pretty

Pretty CInit Source # 
Instance details

Defined in Language.C.Pretty

Pretty CStat Source # 
Instance details

Defined in Language.C.Pretty

Pretty CStorageSpec Source # 
Instance details

Defined in Language.C.Pretty

Pretty CStrLit Source # 
Instance details

Defined in Language.C.Pretty

Pretty CStructUnion Source # 
Instance details

Defined in Language.C.Pretty

Pretty CTranslUnit Source # 
Instance details

Defined in Language.C.Pretty

Pretty CTypeQual Source # 
Instance details

Defined in Language.C.Pretty

Pretty CTypeSpec Source # 
Instance details

Defined in Language.C.Pretty

type Rep NodeInfo Source # 
Instance details

Defined in Language.C.Data.Node

undefNode :: NodeInfo Source #

create a node with neither name nor positional information

isUndefNode :: NodeInfo -> Bool Source #

return True if the node carries neither name nor positional information

mkNodeInfoOnlyPos :: Position -> NodeInfo Source #

| Given only a source position, create a new node attribute

mkNodeInfoPosLen :: Position -> PosLength -> NodeInfo Source #

Given a source position and the position and length of the last token, create a new node attribute

mkNodeInfo :: Position -> Name -> NodeInfo Source #

Given a source position and a unique name, create a new attribute identifier

mkNodeInfo' :: Position -> PosLength -> Name -> NodeInfo Source #

Given a source position, the position and length of the last token and a unique name, create a new attribute identifier. Strict in

internalNode :: NodeInfo Source #

Deprecated: use undefNode instead

class CNode a where Source #

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

Methods

nodeInfo :: a -> NodeInfo Source #

Instances

Instances details
CNode TagFwdDecl Source # 
Instance details

Defined in Language.C.Analysis.DefTable

CNode Attr Source # 
Instance details

Defined in Language.C.Analysis.SemRep

CNode CompType Source # 
Instance details

Defined in Language.C.Analysis.SemRep

CNode CompTypeRef Source # 
Instance details

Defined in Language.C.Analysis.SemRep

CNode Decl Source # 
Instance details

Defined in Language.C.Analysis.SemRep

CNode DeclEvent Source # 
Instance details

Defined in Language.C.Analysis.SemRep

CNode EnumType Source # 
Instance details

Defined in Language.C.Analysis.SemRep

CNode EnumTypeRef Source # 
Instance details

Defined in Language.C.Analysis.SemRep

CNode Enumerator Source # 
Instance details

Defined in Language.C.Analysis.SemRep

CNode FunDef Source # 
Instance details

Defined in Language.C.Analysis.SemRep

CNode IdentDecl Source # 
Instance details

Defined in Language.C.Analysis.SemRep

CNode MemberDecl Source # 
Instance details

Defined in Language.C.Analysis.SemRep

CNode ObjDef Source # 
Instance details

Defined in Language.C.Analysis.SemRep

CNode ParamDecl Source # 
Instance details

Defined in Language.C.Analysis.SemRep

CNode TagDef Source # 
Instance details

Defined in Language.C.Analysis.SemRep

CNode TypeDef Source # 
Instance details

Defined in Language.C.Analysis.SemRep

CNode TypeDefRef Source # 
Instance details

Defined in Language.C.Analysis.SemRep

CNode Ident Source # 
Instance details

Defined in Language.C.Data.Ident

CNode NodeInfo Source # 
Instance details

Defined in Language.C.Data.Node

CNode t1 => CNode (CAlignmentSpecifier t1) Source # 
Instance details

Defined in Language.C.Syntax.AST

CNode t1 => CNode (CAssemblyOperand t1) Source # 
Instance details

Defined in Language.C.Syntax.AST

CNode t1 => CNode (CAssemblyStatement t1) Source # 
Instance details

Defined in Language.C.Syntax.AST

CNode t1 => CNode (CAttribute t1) Source # 
Instance details

Defined in Language.C.Syntax.AST

CNode t1 => CNode (CBuiltinThing t1) Source # 
Instance details

Defined in Language.C.Syntax.AST

CNode t1 => CNode (CCompoundBlockItem t1) Source # 
Instance details

Defined in Language.C.Syntax.AST

CNode t1 => CNode (CConstant t1) Source # 
Instance details

Defined in Language.C.Syntax.AST

CNode t1 => CNode (CDeclaration t1) Source # 
Instance details

Defined in Language.C.Syntax.AST

CNode t1 => CNode (CDeclarationSpecifier t1) Source # 
Instance details

Defined in Language.C.Syntax.AST

CNode t1 => CNode (CDeclarator t1) Source # 
Instance details

Defined in Language.C.Syntax.AST

CNode t1 => CNode (CDerivedDeclarator t1) Source # 
Instance details

Defined in Language.C.Syntax.AST

CNode t1 => CNode (CEnumeration t1) Source # 
Instance details

Defined in Language.C.Syntax.AST

CNode t1 => CNode (CExpression t1) Source # 
Instance details

Defined in Language.C.Syntax.AST

CNode t1 => CNode (CExternalDeclaration t1) Source # 
Instance details

Defined in Language.C.Syntax.AST

CNode t1 => CNode (CFunctionDef t1) Source # 
Instance details

Defined in Language.C.Syntax.AST

CNode t1 => CNode (CFunctionSpecifier t1) Source # 
Instance details

Defined in Language.C.Syntax.AST

CNode t1 => CNode (CInitializer t1) Source # 
Instance details

Defined in Language.C.Syntax.AST

CNode t1 => CNode (CPartDesignator t1) Source # 
Instance details

Defined in Language.C.Syntax.AST

CNode t1 => CNode (CStatement t1) Source # 
Instance details

Defined in Language.C.Syntax.AST

CNode t1 => CNode (CStorageSpecifier t1) Source # 
Instance details

Defined in Language.C.Syntax.AST

CNode t1 => CNode (CStringLiteral t1) Source # 
Instance details

Defined in Language.C.Syntax.AST

CNode t1 => CNode (CStructureUnion t1) Source # 
Instance details

Defined in Language.C.Syntax.AST

CNode t1 => CNode (CTranslationUnit t1) Source # 
Instance details

Defined in Language.C.Syntax.AST

CNode t1 => CNode (CTypeQualifier t1) Source # 
Instance details

Defined in Language.C.Syntax.AST

CNode t1 => CNode (CTypeSpecifier t1) Source # 
Instance details

Defined in Language.C.Syntax.AST

(CNode a, CNode b) => CNode (Either a b) Source # 
Instance details

Defined in Language.C.Data.Node

Methods

nodeInfo :: Either a b -> NodeInfo Source #

getLastTokenPos :: NodeInfo -> PosLength Source #

get the position and length of the last token

lengthOfNode :: NodeInfo -> Maybe Int Source #

get the number of characters an AST node spans

eqByName :: CNode a => a -> a -> Bool Source #

equality by name