language-c-0.7.1: 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 HaskellNone
LanguageHaskell98

Language.C.Data.Node

Description

source position and unqiue name

Synopsis

Documentation

data NodeInfo Source #

Parsed entity attribute

Instances

Eq NodeInfo Source # 
Data NodeInfo Source # 

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 :: (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 #

Ord NodeInfo Source # 
Show NodeInfo Source # 
Pos NodeInfo Source # 
CNode NodeInfo Source # 
Pretty CStrLit Source # 
Pretty CConst Source # 
Pretty CBuiltin Source # 
Pretty CExpr Source # 
Pretty CAttr Source # 
Pretty CDesignator Source # 
Pretty CInit Source # 
Pretty CEnum Source # 
Pretty CStructUnion Source # 
Pretty CAlignSpec Source # 
Pretty CFunSpec Source # 
Pretty CTypeQual Source # 
Pretty CTypeSpec Source # 
Pretty CStorageSpec Source # 
Pretty CDeclSpec Source # 
Pretty CBlockItem Source # 
Pretty CAsmOperand Source # 
Pretty CAsmStmt Source # 
Pretty CStat Source # 
Pretty CArrSize Source # 
Pretty CDeclr Source # 
Pretty CDecl Source # 
Pretty CFunDef Source # 
Pretty CExtDecl Source # 
Pretty CTranslUnit Source # 

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

Minimal complete definition

nodeInfo

Methods

nodeInfo :: a -> NodeInfo Source #

Instances

CNode NodeInfo Source # 
CNode Ident Source # 
CNode Attr Source # 
CNode Enumerator Source # 
CNode EnumType Source # 
CNode CompType Source # 
CNode EnumTypeRef Source # 
CNode CompTypeRef Source # 
CNode TypeDefRef Source # 
CNode TypeDef Source # 
CNode MemberDecl Source # 
CNode ParamDecl Source # 
CNode FunDef Source # 
CNode ObjDef Source # 
CNode Decl Source # 
CNode DeclEvent Source # 
CNode IdentDecl Source # 
CNode TagDef Source # 
CNode TagFwdDecl Source # 
CNode t1 => CNode (CStringLiteral t1) Source # 
CNode t1 => CNode (CConstant t1) Source # 
CNode t1 => CNode (CBuiltinThing t1) Source # 
CNode t1 => CNode (CExpression t1) Source # 
CNode t1 => CNode (CAttribute t1) Source # 
CNode t1 => CNode (CPartDesignator t1) Source # 
CNode t1 => CNode (CInitializer t1) Source # 
CNode t1 => CNode (CEnumeration t1) Source # 
CNode t1 => CNode (CStructureUnion t1) Source # 
CNode t1 => CNode (CAlignmentSpecifier t1) Source # 
CNode t1 => CNode (CFunctionSpecifier t1) Source # 
CNode t1 => CNode (CTypeQualifier t1) Source # 
CNode t1 => CNode (CTypeSpecifier t1) Source # 
CNode t1 => CNode (CStorageSpecifier t1) Source # 
CNode t1 => CNode (CDeclarationSpecifier t1) Source # 
CNode t1 => CNode (CCompoundBlockItem t1) Source # 
CNode t1 => CNode (CAssemblyOperand t1) Source # 
CNode t1 => CNode (CAssemblyStatement t1) Source # 
CNode t1 => CNode (CStatement t1) Source # 
CNode t1 => CNode (CDerivedDeclarator t1) Source # 
CNode t1 => CNode (CDeclarator t1) Source # 
CNode t1 => CNode (CDeclaration t1) Source # 
CNode t1 => CNode (CFunctionDef t1) Source # 
CNode t1 => CNode (CExternalDeclaration t1) Source # 
CNode t1 => CNode (CTranslationUnit t1) Source # 
(CNode a, CNode b) => CNode (Either a b) Source # 

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