language-c-0.5.0: 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

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

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

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