| Copyright | (c) Galois Inc 2014-2020 |
|---|---|
| License | BSD3 |
| Maintainer | Joe Hendrix <[email protected]> |
| Stability | provisional |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
What4.ProgramLoc
Description
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 ann
- 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
Constructors
| 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 ann Source #
A value with a source position associated.
Instances
| Foldable Posd Source # | |
Defined in What4.ProgramLoc Methods fold :: Monoid m => Posd m -> m # foldMap :: Monoid m => (a -> m) -> Posd a -> 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 # | |
| Functor Posd Source # | |
| Show v => Show (Posd v) Source # | |
| NFData v => NFData (Posd v) Source # | |
Defined in What4.ProgramLoc | |
| Eq v => Eq (Posd v) Source # | |
data ProgramLoc Source #
A very small type that contains a function and PC identifier.
Instances
| Show ProgramLoc Source # | |
Defined in What4.ProgramLoc Methods showsPrec :: Int -> ProgramLoc -> ShowS # show :: ProgramLoc -> String # showList :: [ProgramLoc] -> ShowS # | |
| Eq ProgramLoc Source # | |
Defined in What4.ProgramLoc | |
| Ord ProgramLoc Source # | |
Defined in What4.ProgramLoc Methods compare :: ProgramLoc -> ProgramLoc -> Ordering # (<) :: ProgramLoc -> ProgramLoc -> Bool # (<=) :: ProgramLoc -> ProgramLoc -> Bool # (>) :: ProgramLoc -> ProgramLoc -> Bool # (>=) :: ProgramLoc -> ProgramLoc -> Bool # max :: ProgramLoc -> ProgramLoc -> ProgramLoc # min :: ProgramLoc -> ProgramLoc -> ProgramLoc # | |
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 #
Methods
programLoc :: Lens' v ProgramLoc Source #