language-objc-0.4.2.3: Analysis and generation of Objective C code

Portabilityghc
Stabilityexperimental
Maintainerjwlato@gmail.com
Safe HaskellNone

Language.ObjC.Data.Position

Description

Source code position

Synopsis

Documentation

data Position Source

uniform representation of source file positions

Constructors

Position 

Fields

posOffset' :: !Int

absolute offset in the preprocessed file

posFile' :: String

source file

posRow' :: !Int

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

posColumn' :: !Int

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

NoPosition 
BuiltinPosition 
InternalPosition 

position :: Int -> String -> Int -> Int -> PositionSource

position absoluteOffset fileName lineNumber columnNumber initializes a Position using the given arguments

data PosLength Source

Position and length of a token

Constructors

PL !Position !Int 

initPos :: FilePath -> PositionSource

initialize a Position to the start of the translation unit starting in the given file

isSourcePos :: Position -> BoolSource

returns True if the given position refers to an actual source file

nopos :: PositionSource

no position (for unknown position information)

isNoPos :: Position -> BoolSource

returns True if the there is no position information available

builtinPos :: PositionSource

position attached to built-in objects

isBuiltinPos :: Position -> BoolSource

returns True if the given position refers to a builtin definition

internalPos :: PositionSource

position used for internal errors

isInternalPos :: Position -> BoolSource

returns True if the given position is internal

incPos :: Position -> Int -> PositionSource

advance column

retPos :: Position -> PositionSource

advance to next line

adjustPos :: FilePath -> Int -> Position -> PositionSource

adjust position: change file and line number, reseting column to 1. This is usually used for #LINE pragmas. The absolute offset is not changed - this can be done by adjustPos newFile line . incPos (length pragma).

incOffset :: Position -> Int -> PositionSource

advance just the offset

class Pos a whereSource

class of type which aggregate a source code location

Methods

posOf :: a -> PositionSource

Instances

Pos NodeInfo 
Pos Ident 
Pos CToken 
Pos CDeclrR 
Pos Attr 
Pos Enumerator 
Pos EnumType 
Pos CompType 
Pos EnumTypeRef 
Pos CompTypeRef 
Pos TypeDefRef 
Pos TypeDef 
Pos MemberDecl 
Pos ParamDecl 
Pos FunDef 
Pos ObjDef 
Pos Decl 
Pos DeclEvent 
Pos IdentDecl 
Pos TagDef 
Pos a => Pos [a] 
Pos a => Pos (Reversed a) 
CNode t1 => Pos (CStringLiteral t1) 
CNode t1 => Pos (CConstant t1) 
CNode t1 => Pos (ObjCConstant t1) 
CNode t1 => Pos (CBuiltinThing t1) 
CNode t1 => Pos (ObjCKeywordArg t1) 
CNode t1 => Pos (ObjCMessageSelector t1) 
CNode t1 => Pos (ObjCMessageExpression t1) 
CNode t1 => Pos (ObjCSelector t1) 
CNode t1 => Pos (ObjCSelectorKeyName t1) 
CNode t1 => Pos (ObjCSelectorName t1) 
CNode t1 => Pos (CExpression t1) 
CNode t1 => Pos (CAttribute t1) 
CNode t1 => Pos (CPartDesignator t1) 
CNode t1 => Pos (CInitializer t1) 
CNode t1 => Pos (CEnumeration t1) 
CNode t1 => Pos (CStructureUnion t1) 
CNode t1 => Pos (ObjCProtoQualifier t1) 
CNode t1 => Pos (CTypeQualifier t1) 
CNode t1 => Pos (CTypeSpecifier t1) 
CNode t1 => Pos (CStorageSpecifier t1) 
CNode t1 => Pos (CDeclarationSpecifier t1) 
CNode t1 => Pos (CCompoundBlockItem t1) 
CNode t1 => Pos (CAssemblyOperand t1) 
CNode t1 => Pos (CAssemblyStatement t1) 
CNode t1 => Pos (CStatement t1) 
CNode t1 => Pos (CDerivedDeclarator t1) 
CNode t1 => Pos (CDeclarator t1) 
CNode t1 => Pos (CDeclaration t1) 
CNode t1 => Pos (ObjCPropertyModifier t1) 
CNode t1 => Pos (ObjCPropertyDeclaration t1) 
CNode t1 => Pos (ObjCKeywordDeclarator t1) 
CNode t1 => Pos (ObjCMethodSelector t1) 
CNode t1 => Pos (ObjCMethodDefinition t1) 
CNode t1 => Pos (ObjCMethodDeclaration t1) 
CNode t1 => Pos (ObjCImplementationDefinition t1) 
CNode t1 => Pos (ObjCInterfaceDeclaration t1) 
CNode t1 => Pos (ObjCVisibilitySpec t1) 
CNode t1 => Pos (ObjCInstanceVariableBlock t1) 
CNode t1 => Pos (ObjCProtocolName t1) 
CNode t1 => Pos (ObjCClassName t1) 
CNode t1 => Pos (ObjCClassDeclarator t1) 
CNode t1 => Pos (ObjCImplementation t1) 
CNode t1 => Pos (ObjCInterface t1) 
CNode t1 => Pos (ObjCProtocolDeclBlock t1) 
CNode t1 => Pos (ObjCProtocolDec t1) 
CNode t1 => Pos (ObjCClassListDef t1) 
CNode t1 => Pos (ObjCCategoryImplementation t1) 
CNode t1 => Pos (ObjCCategoryDec t1) 
CNode t1 => Pos (CFunctionDef t1) 
CNode t1 => Pos (CExternalDeclaration t1) 
CNode t1 => Pos (CTranslationUnit t1) 
Pos (Located a)