Copyright | (c) Galois Inc 2014-2020 |
---|---|
License | BSD3 |
Maintainer | Joe Hendrix <jhendrix@galois.com> |
Stability | provisional |
Safe Haskell | None |
Language | Haskell2010 |
This module primarily defines the Position
datatype for
handling program location data. A program location may refer
either to a source file location (file name, line and column number),
a binary file location (file name and byte offset) or be a dummy
"internal" location assigned to generated program fragments.
Synopsis
- data Position
- sourcePos :: FilePath -> Int -> Int -> Position
- startOfFile :: FilePath -> Position
- ppNoFileName :: Position -> Doc
- data Posd v = Posd {}
- data ProgramLoc
- mkProgramLoc :: FunctionName -> Position -> ProgramLoc
- initializationLoc :: ProgramLoc
- plFunction :: ProgramLoc -> FunctionName
- plSourceLoc :: ProgramLoc -> Position
- class HasProgramLoc v where
- programLoc :: Lens' v ProgramLoc
Documentation
SourcePos !Text !Int !Int | A source position containing filename, line, and column. |
BinaryPos !Text !Word64 | A binary position containing a filename and address in memory. |
OtherPos !Text | Some unstructured position information that doesn't fit into the other categories. |
InternalPos | Generated internally by the simulator, or otherwise unknown. |
startOfFile :: FilePath -> Position Source #
ppNoFileName :: Position -> Doc Source #
A value with a source position associated.
Instances
Functor Posd Source # | |
Foldable Posd Source # | |
Defined in What4.ProgramLoc fold :: Monoid m => Posd m -> m # foldMap :: Monoid m => (a -> m) -> Posd a -> m # foldr :: (a -> b -> b) -> b -> Posd a -> b # foldr' :: (a -> b -> b) -> b -> Posd a -> b # foldl :: (b -> a -> b) -> b -> Posd a -> b # foldl' :: (b -> a -> b) -> b -> Posd a -> b # foldr1 :: (a -> a -> a) -> Posd a -> a # foldl1 :: (a -> a -> a) -> Posd a -> a # elem :: Eq a => a -> Posd a -> Bool # maximum :: Ord a => Posd a -> a # | |
Traversable Posd Source # | |
Eq v => Eq (Posd v) Source # | |
Show v => Show (Posd v) Source # | |
NFData v => NFData (Posd v) Source # | |
Defined in What4.ProgramLoc |
data ProgramLoc Source #
A very small type that contains a function and PC identifier.
Instances
Eq ProgramLoc Source # | |
Defined in What4.ProgramLoc (==) :: ProgramLoc -> ProgramLoc -> Bool # (/=) :: ProgramLoc -> ProgramLoc -> Bool # | |
Ord ProgramLoc Source # | |
Defined in What4.ProgramLoc compare :: ProgramLoc -> ProgramLoc -> Ordering # (<) :: ProgramLoc -> ProgramLoc -> Bool # (<=) :: ProgramLoc -> ProgramLoc -> Bool # (>) :: ProgramLoc -> ProgramLoc -> Bool # (>=) :: ProgramLoc -> ProgramLoc -> Bool # max :: ProgramLoc -> ProgramLoc -> ProgramLoc # min :: ProgramLoc -> ProgramLoc -> ProgramLoc # | |
Show ProgramLoc Source # | |
Defined in What4.ProgramLoc showsPrec :: Int -> ProgramLoc -> ShowS # show :: ProgramLoc -> String # showList :: [ProgramLoc] -> ShowS # |
mkProgramLoc :: FunctionName -> Position -> ProgramLoc Source #
Make a program loc
initializationLoc :: ProgramLoc Source #
Location for initialization code
plFunction :: ProgramLoc -> FunctionName Source #
plSourceLoc :: ProgramLoc -> Position Source #
Objects with a program location associated.
class HasProgramLoc v where Source #
programLoc :: Lens' v ProgramLoc Source #