-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Parsers and analyses for Fortran standards 66, 77, 90 and 95. -- -- Provides lexing, parsing, and basic analyses of Fortran code covering -- standards: FORTRAN 66, FORTRAN 77, Fortran 90, and Fortran 95 and some -- legacy extensions. Includes data flow and basic block analysis, a -- renamer, and type analysis. For example usage, see the camfort -- project, which uses fortran-src as its front end. @package fortran-src @version 0.4.2 -- | Simple module to provide functions that read Fortran literals module Language.Fortran.Parser.Utils -- | Convert a Fortran literal Real into a Haskell Double. readReal :: String -> Maybe Double -- | Convert a Fortran literal Integer into a Haskell Integer. readInteger :: String -> Maybe Integer module Language.Fortran.Rewriter.Internal -- | Represents location in source code. -- -- Note that, SourceLocation indicates space between characters, -- i.e the following example: -- --
-- SourceLocation 0 1 ---- -- indicates position between first and second characters in a file. data SourceLocation SourceLocation :: Int -> Int -> SourceLocation -- | Represents range in source code. data SourceRange SourceRange :: SourceLocation -> SourceLocation -> SourceRange -- | Represents a character in the original source text along with any -- replacement operations applied to the character in place. -- -- It expects a character (in case it's empty, Nothing should be used), -- whether it should be removed, its SourceLocation and a string -- that should be put in place of it. data RChar RChar :: Maybe Char -> Bool -> SourceLocation -> ByteString -> RChar -- | Represents the intent to replace content in the file. -- -- The content in Replacement will be used in place of what is in -- the range described. Note that the replacement text can be shorter or -- larger than the original span, and it can also be multi-line. data Replacement Replacement :: SourceRange -> String -> Replacement -- | Exception raised when two Replacement objects overlap -- (OverlappingError) or Replacement points at invalid -- locations (InvalidRangeError). data ReplacementError OverlappingError :: [(Replacement, Replacement)] -> ReplacementError InvalidRangeError :: ReplacementError -- | As we advance through the [RChar] list, we consider "chunks" as -- the unit of text written out. A chunk is either: -- --
-- SourceLocation 0 1 ---- -- indicates position between first and second characters in a file. data SourceLocation SourceLocation :: Int -> Int -> SourceLocation -- | Represents range in source code. data SourceRange SourceRange :: SourceLocation -> SourceLocation -> SourceRange -- | Represents the intent to replace content in the file. -- -- The content in Replacement will be used in place of what is in -- the range described. Note that the replacement text can be shorter or -- larger than the original span, and it can also be multi-line. data Replacement Replacement :: SourceRange -> String -> Replacement -- | Exception raised when two Replacement objects overlap -- (OverlappingError) or Replacement points at invalid -- locations (InvalidRangeError). data ReplacementError OverlappingError :: [(Replacement, Replacement)] -> ReplacementError InvalidRangeError :: ReplacementError -- | Represents map of files and replacements that will be done. type ReplacementMap = Map String [Replacement] -- | Remove overlapping items from a list of replacements and return a pair -- of lists containing disjoint items and overlapping items, -- respectively. -- -- Important notes: -- -- Replacements that come first in the list will be given precedence over -- later items. partitionOverlapping :: [Replacement] -> ([Replacement], [Replacement]) -- | Apply a list of Replacements to the orginal source file. -- -- Important notes: -- -- Source locations specified in replacements are 0-indexed. -- -- Rewriting applies continuation lines when lines are longer than 72 -- characters. -- -- Example replacements: -- -- Delete the first character in a file -- --
-- Replacement (SourceRange (SourceLocation 0 0) (SourceLocation 0 1)) "" ---- -- Prepend "a" to 1 line, 2 column character -- --
-- Replacement (SourceRange (SourceLocation 0 1) (SourceLocation 0 1)) "a" ---- -- Replace a character located in 2 line, 4 column with "a" -- --
-- Replacement (SourceRange (SourceLocation 1 3) (SourceLocation 1 4)) "a" ---- -- Replace string starting in 2 line, 4 column and ending in 2 line, 6 -- column (inclusive) with "a" -- --
-- Replacement (SourceRange (SourceLocation 1 3) (SourceLocation 1 6)) "a" --processReplacements :: ReplacementMap -> IO () -- | Utility function to convert SrcSpan to SourceRange spanToSourceRange :: SrcSpan -> SourceRange -- | Given two Spans, returns a SourceRange that starts -- at the starting location of the first span, and ends at the starting -- location of the second span spanToSourceRange2 :: SrcSpan -> SrcSpan -> SourceRange -- | Given two Spans, returns a SourceRange that starts -- at the ending location of the first span, and ends at the starting -- location of the second span sourceRangeBetweenTwoSpans :: SrcSpan -> SrcSpan -> SourceRange -- | Fortran version enum and tools for selecting version for a given file. module Language.Fortran.Version data FortranVersion Fortran66 :: FortranVersion Fortran77 :: FortranVersion Fortran77Extended :: FortranVersion Fortran77Legacy :: FortranVersion Fortran90 :: FortranVersion Fortran95 :: FortranVersion Fortran2003 :: FortranVersion Fortran2008 :: FortranVersion fortranVersionAliases :: [(String, FortranVersion)] selectFortranVersion :: String -> Maybe FortranVersion -- | Deduce the FortranVersion from a FilePath using -- extension. -- -- Defaults to Fortran 90 if suffix is unrecognized. deduceFortranVersion :: FilePath -> FortranVersion -- | Alias for previous function name. TODO: deprecate eventually. deduceVersion :: FilePath -> FortranVersion instance GHC.Generics.Generic Language.Fortran.Version.FortranVersion instance Data.Data.Data Language.Fortran.Version.FortranVersion instance GHC.Classes.Eq Language.Fortran.Version.FortranVersion instance GHC.Classes.Ord Language.Fortran.Version.FortranVersion instance GHC.Show.Show Language.Fortran.Version.FortranVersion module Language.Fortran.ParserMonad class Tok a eofToken :: Tok a => a -> Bool newtype Parse b c a Parse :: (ParseState b -> ParseResult b c a) -> Parse b c a [unParse] :: Parse b c a -> ParseState b -> ParseResult b c a class LastToken a b | a -> b getLastToken :: (LastToken a b, Show b) => a -> Maybe b data ParseErrorSimple ParseErrorSimple :: Position -> String -> String -> ParseErrorSimple [errorPos] :: ParseErrorSimple -> Position [errorFilename] :: ParseErrorSimple -> String [errorMsg] :: ParseErrorSimple -> String data ParseResult b c a ParseOk :: a -> ParseState b -> ParseResult b c a ParseFailed :: ParseError b c -> ParseResult b c a data ParseError a b ParseError :: Position -> Maybe b -> String -> String -> ParseError a b [errPos] :: ParseError a b -> Position [errLastToken] :: ParseError a b -> Maybe b [errFilename] :: ParseError a b -> String [errMsg] :: ParseError a b -> String data ParseState a ParseState :: a -> ParanthesesCount -> FortranVersion -> String -> [Context] -> ParseState a [psAlexInput] :: ParseState a -> a [psParanthesesCount] :: ParseState a -> ParanthesesCount [psVersion] :: ParseState a -> FortranVersion [psFilename] :: ParseState a -> String [psContext] :: ParseState a -> [Context] data Context ConStart :: Context ConData :: Context ConImplicit :: Context ConNamelist :: Context ConCommon :: Context data ParanthesesCount ParanthesesCount :: Integer -> Bool -> ParanthesesCount [pcActual] :: ParanthesesCount -> Integer [pcHasReached0] :: ParanthesesCount -> Bool tokenMsg :: Show a => Maybe a -> String fromParseResultUnsafe :: Show c => ParseResult b c a -> a fromRight :: Show a => Either a b -> b fromParseResult :: Show c => ParseResult b c a -> Either ParseErrorSimple a getVersion :: (Loc a, LastToken a b, Show b) => Parse a b FortranVersion putAlex :: (Loc a, LastToken a b, Show b) => a -> Parse a b () getAlex :: (Loc a, LastToken a b, Show b) => Parse a b a topContext :: (Loc a, LastToken a b, Show b) => Parse a b Context popContext :: (Loc a, LastToken a b, Show b) => Parse a b () pushContext :: (Loc a, LastToken a b, Show b) => Context -> Parse a b () getPosition :: (Loc a, LastToken a b, Show b) => Parse a b Position getSrcSpan :: (Loc a, LastToken a b, Show b) => Position -> Parse a b SrcSpan getParanthesesCount :: (Loc a, LastToken a b, Show b) => Parse a b ParanthesesCount resetPar :: (Loc a, LastToken a b, Show b) => Parse a b () incPar :: (Loc a, LastToken a b, Show b) => Parse a b () decPar :: (Loc a, LastToken a b, Show b) => Parse a b () throwIOerror :: String -> a runParse :: (Loc b, LastToken b c, Show c) => Parse b c a -> ParseState b -> ParseResult b c a runParseUnsafe :: (Loc b, LastToken b c, Show c) => Parse b c a -> ParseState b -> (a, ParseState b) evalParse :: (Loc b, LastToken b c, Show c) => Parse b c a -> ParseState b -> a execParse :: (Loc b, LastToken b c, Show c) => Parse b c a -> ParseState b -> ParseState b collectTokens :: forall a b. (Loc b, Tok a, LastToken b a, Show a) => Parse b a a -> ParseState b -> [a] collectTokensSafe :: forall a b. (Loc b, Tok a, LastToken b a, Show a) => Parse b a a -> ParseState b -> Maybe [a] instance GHC.Classes.Eq Language.Fortran.ParserMonad.ParanthesesCount instance GHC.Show.Show Language.Fortran.ParserMonad.ParanthesesCount instance GHC.Classes.Eq Language.Fortran.ParserMonad.Context instance GHC.Show.Show Language.Fortran.ParserMonad.Context instance GHC.Show.Show a => GHC.Show.Show (Language.Fortran.ParserMonad.ParseState a) instance (Language.Fortran.Util.Position.Loc b, Language.Fortran.ParserMonad.LastToken b c, GHC.Show.Show c) => GHC.Base.Monad (Language.Fortran.ParserMonad.Parse b c) instance (Language.Fortran.Util.Position.Loc b, Language.Fortran.ParserMonad.LastToken b c, GHC.Show.Show c) => Control.Monad.Fail.MonadFail (Language.Fortran.ParserMonad.Parse b c) instance (Language.Fortran.Util.Position.Loc b, Language.Fortran.ParserMonad.LastToken b c, GHC.Show.Show c) => GHC.Base.Functor (Language.Fortran.ParserMonad.Parse b c) instance (Language.Fortran.Util.Position.Loc b, Language.Fortran.ParserMonad.LastToken b c, GHC.Show.Show c) => GHC.Base.Applicative (Language.Fortran.ParserMonad.Parse b c) instance (Language.Fortran.Util.Position.Loc b, Language.Fortran.ParserMonad.LastToken b c, GHC.Show.Show c) => Control.Monad.State.Class.MonadState (Language.Fortran.ParserMonad.ParseState b) (Language.Fortran.ParserMonad.Parse b c) instance (Language.Fortran.Util.Position.Loc b, Language.Fortran.ParserMonad.LastToken b c, GHC.Show.Show c) => Control.Monad.Error.Class.MonadError (Language.Fortran.ParserMonad.ParseError b c) (Language.Fortran.ParserMonad.Parse b c) instance GHC.Show.Show Language.Fortran.ParserMonad.ParseErrorSimple instance GHC.Base.Functor (Language.Fortran.ParserMonad.ParseResult b c) instance GHC.Show.Show b => GHC.Show.Show (Language.Fortran.ParserMonad.ParseError a b) instance (Data.Typeable.Internal.Typeable a, Data.Typeable.Internal.Typeable b, GHC.Show.Show a, GHC.Show.Show b) => GHC.Exception.Type.Exception (Language.Fortran.ParserMonad.ParseError a b) module Language.Fortran.Lexer.FreeForm alex_tab_size :: Int alex_base :: AlexAddr alex_table :: AlexAddr alex_check :: AlexAddr alex_deflt :: AlexAddr alex_accept :: Array Int (AlexAcc User) alex_actions :: Array Int (LexAction (Maybe Token)) alexIndexInt32OffAddr :: AlexAddr -> Int# -> Int# quickIndex :: Array Int (AlexAcc User) -> Int -> AlexAcc User data AlexReturn a AlexEOF :: AlexReturn a AlexError :: !AlexInput -> AlexReturn a AlexSkip :: !AlexInput -> !Int -> AlexReturn a AlexToken :: !AlexInput -> !Int -> a -> AlexReturn a alexScan :: AlexInput -> Int -> AlexReturn (LexAction (Maybe Token)) alex_scan_tkn :: User -> AlexInput -> Int# -> AlexInput -> Int# -> AlexLastAcc -> (AlexLastAcc, AlexInput) data AlexLastAcc AlexNone :: AlexLastAcc AlexLastAcc :: !Int -> !AlexInput -> !Int -> AlexLastAcc AlexLastSkip :: !AlexInput -> !Int -> AlexLastAcc data AlexAcc user AlexAccNone :: AlexAcc user AlexAcc :: Int -> AlexAcc user AlexAccSkip :: AlexAcc user AlexAccPred :: Int -> AlexAccPred user -> AlexAcc user -> AlexAcc user AlexAccSkipPred :: AlexAccPred user -> AlexAcc user -> AlexAcc user type AlexAccPred user = user -> AlexInput -> Int -> AlexInput -> Bool alexAndPred :: (t1 -> t2 -> t3 -> t4 -> Bool) -> (t1 -> t2 -> t3 -> t4 -> Bool) -> t1 -> t2 -> t3 -> t4 -> Bool alexPrevCharIs :: Char -> p1 -> AlexInput -> p2 -> p3 -> Bool alexPrevCharMatches :: (Char -> t) -> p1 -> AlexInput -> p2 -> p3 -> t alexPrevCharIsOneOf :: Array Char e -> p1 -> AlexInput -> p2 -> p3 -> e alexRightContext :: Int -> AlexAccPred User formatP :: User -> AlexInput -> Int -> AlexInput -> Bool followsDoP :: User -> AlexInput -> Int -> AlexInput -> Bool followsColonP :: User -> AlexInput -> Int -> AlexInput -> Bool labelledWhereP :: User -> AlexInput -> Int -> AlexInput -> Bool selectorP :: User -> AlexInput -> Int -> AlexInput -> Bool ifConditionEndP :: User -> AlexInput -> Int -> AlexInput -> Bool opP :: User -> AlexInput -> Int -> AlexInput -> Bool partOfExpOrPointerAssignmentP :: User -> AlexInput -> Int -> AlexInput -> Bool precedesDoubleColon :: AlexInput -> Bool parenLevel :: [Token] -> Int allocateP :: User -> AlexInput -> Int -> AlexInput -> Bool attributeP :: User -> AlexInput -> Int -> AlexInput -> Bool bindP :: User -> AlexInput -> Int -> AlexInput -> Bool constructNameP :: User -> AlexInput -> Int -> AlexInput -> Bool genericSpecP :: User -> AlexInput -> Int -> AlexInput -> Bool notDefinedOperP :: User -> AlexInput -> Int -> AlexInput -> Bool typeSpecP :: User -> AlexInput -> Int -> AlexInput -> Bool resultP :: User -> AlexInput -> Int -> AlexInput -> Bool notPrecedingDotP :: User -> AlexInput -> Int -> AlexInput -> Bool followsIntentP :: User -> AlexInput -> Int -> AlexInput -> Bool followsProcedureP :: User -> AlexInput -> Int -> AlexInput -> Bool followsBindP :: User -> AlexInput -> Int -> AlexInput -> Bool followsCP :: User -> AlexInput -> Int -> AlexInput -> Bool followsFlushP :: User -> AlexInput -> Int -> AlexInput -> Bool useStP :: User -> AlexInput -> Int -> AlexInput -> Bool caseStP :: User -> AlexInput -> Int -> AlexInput -> Bool assignStP :: User -> AlexInput -> Int -> AlexInput -> Bool prevTokenConstr :: AlexInput -> Maybe Constr nextTokenConstr :: User -> AlexInput -> Maybe Constr seenConstr :: Constr -> AlexInput -> Bool fillConstr :: (a -> Token) -> Constr adjustComment :: LexAction (Maybe Token) -> LexAction (Maybe Token) leftPar :: LexAction (Maybe Token) comma :: LexAction (Maybe Token) slashOrDivision :: LexAction (Maybe Token) addSpan :: (SrcSpan -> Token) -> LexAction (Maybe Token) addSpanAndMatch :: (SrcSpan -> String -> Token) -> LexAction (Maybe Token) getLexeme :: LexAction Lexeme putLexeme :: Lexeme -> LexAction () resetLexeme :: LexAction () getMatch :: LexAction String putMatch :: String -> LexAction () updatePreviousToken :: Maybe Token -> LexAction () addToPreviousTokensInLine :: Token -> LexAction () checkPreviousTokensInLine :: (Token -> Bool) -> AlexInput -> Bool getLexemeSpan :: LexAction SrcSpan lexCharacter :: LexAction (Maybe Token) toSC :: Int -> LexAction () stabiliseStartCode :: LexAction () normaliseStartCode :: LexAction () invalidPosition :: Position isValidPosition :: Position -> Bool data Lexeme Lexeme :: !String -> {-# UNPACK #-} !Position -> {-# UNPACK #-} !Position -> !Bool -> Lexeme [lexemeMatch] :: Lexeme -> !String [lexemeStart] :: Lexeme -> {-# UNPACK #-} !Position [lexemeEnd] :: Lexeme -> {-# UNPACK #-} !Position [lexemeIsCmt] :: Lexeme -> !Bool initLexeme :: Lexeme data StartCodeStatus Return :: StartCodeStatus Stable :: StartCodeStatus data StartCode StartCode :: {-# UNPACK #-} !Int -> !StartCodeStatus -> StartCode [scActual] :: StartCode -> {-# UNPACK #-} !Int [scStatus] :: StartCode -> !StartCodeStatus data AlexInput AlexInput :: !ByteString -> {-# UNPACK #-} !Position -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Char -> {-# UNPACK #-} !Lexeme -> {-# UNPACK #-} !StartCode -> !Maybe Token -> ![Token] -> AlexInput [aiSourceBytes] :: AlexInput -> !ByteString [aiPosition] :: AlexInput -> {-# UNPACK #-} !Position [aiEndOffset] :: AlexInput -> {-# UNPACK #-} !Int [aiPreviousChar] :: AlexInput -> {-# UNPACK #-} !Char [aiLexeme] :: AlexInput -> {-# UNPACK #-} !Lexeme [aiStartCode] :: AlexInput -> {-# UNPACK #-} !StartCode [aiPreviousToken] :: AlexInput -> !Maybe Token [aiPreviousTokensInLine] :: AlexInput -> ![Token] type LexAction a = Parse AlexInput Token a vanillaAlexInput :: AlexInput updateLexeme :: Char -> Position -> AlexInput -> AlexInput data User User :: FortranVersion -> ParanthesesCount -> User data Move Continuation :: Move Char :: Move Newline :: Move alexGetByte :: AlexInput -> Maybe (Word8, AlexInput) alexInputPrevChar :: AlexInput -> Char currentChar :: AlexInput -> Char advanceWithoutContinuation :: AlexInput -> Maybe AlexInput isContinuation :: AlexInput -> Bool skipContinuation :: AlexInput -> AlexInput skipCComment :: LexAction (Maybe Token) advance :: Move -> Position -> Position lexHash :: LexAction (Maybe Token) lexer :: (Token -> LexAction a) -> LexAction a lexer' :: LexAction Token alexScanUser :: User -> AlexInput -> Int -> AlexReturn (LexAction (Maybe Token)) data Token TId :: SrcSpan -> String -> Token TComment :: SrcSpan -> String -> Token TString :: SrcSpan -> String -> Token TIntegerLiteral :: SrcSpan -> String -> Token TRealLiteral :: SrcSpan -> String -> Token TBozLiteral :: SrcSpan -> String -> Token TComma :: SrcSpan -> Token TComma2 :: SrcSpan -> Token TSemiColon :: SrcSpan -> Token TColon :: SrcSpan -> Token TDoubleColon :: SrcSpan -> Token TOpAssign :: SrcSpan -> Token TArrow :: SrcSpan -> Token TPercent :: SrcSpan -> Token TLeftPar :: SrcSpan -> Token TLeftPar2 :: SrcSpan -> Token TRightPar :: SrcSpan -> Token TLeftInitPar :: SrcSpan -> Token TRightInitPar :: SrcSpan -> Token TOpCustom :: SrcSpan -> String -> Token TOpExp :: SrcSpan -> Token TOpPlus :: SrcSpan -> Token TOpMinus :: SrcSpan -> Token TStar :: SrcSpan -> Token TOpDivision :: SrcSpan -> Token TSlash :: SrcSpan -> Token TOpOr :: SrcSpan -> Token TOpAnd :: SrcSpan -> Token TOpNot :: SrcSpan -> Token TOpEquivalent :: SrcSpan -> Token TOpNotEquivalent :: SrcSpan -> Token TOpLT :: SrcSpan -> Token TOpLE :: SrcSpan -> Token TOpEQ :: SrcSpan -> Token TOpNE :: SrcSpan -> Token TOpGT :: SrcSpan -> Token TOpGE :: SrcSpan -> Token TLogicalLiteral :: SrcSpan -> String -> Token TProgram :: SrcSpan -> Token TEndProgram :: SrcSpan -> Token TFunction :: SrcSpan -> Token TEndFunction :: SrcSpan -> Token TResult :: SrcSpan -> Token TPure :: SrcSpan -> Token TElemental :: SrcSpan -> Token TRecursive :: SrcSpan -> Token TSubroutine :: SrcSpan -> Token TEndSubroutine :: SrcSpan -> Token TBlockData :: SrcSpan -> Token TEndBlockData :: SrcSpan -> Token TModule :: SrcSpan -> Token TEndModule :: SrcSpan -> Token TContains :: SrcSpan -> Token TUse :: SrcSpan -> Token TOnly :: SrcSpan -> Token TImport :: SrcSpan -> Token TAbstract :: SrcSpan -> Token TInterface :: SrcSpan -> Token TEndInterface :: SrcSpan -> Token TProcedure :: SrcSpan -> Token TModuleProcedure :: SrcSpan -> Token TAssignment :: SrcSpan -> Token TOperator :: SrcSpan -> Token TCall :: SrcSpan -> Token TReturn :: SrcSpan -> Token TEntry :: SrcSpan -> Token TInclude :: SrcSpan -> Token TBind :: SrcSpan -> Token TC :: SrcSpan -> Token TName :: SrcSpan -> Token TAllocatable :: SrcSpan -> Token TAsynchronous :: SrcSpan -> Token TDimension :: SrcSpan -> Token TExternal :: SrcSpan -> Token TIntent :: SrcSpan -> Token TIntrinsic :: SrcSpan -> Token TNonIntrinsic :: SrcSpan -> Token TOptional :: SrcSpan -> Token TParameter :: SrcSpan -> Token TPointer :: SrcSpan -> Token TPrivate :: SrcSpan -> Token TPublic :: SrcSpan -> Token TProtected :: SrcSpan -> Token TSave :: SrcSpan -> Token TTarget :: SrcSpan -> Token TValue :: SrcSpan -> Token TVolatile :: SrcSpan -> Token TIn :: SrcSpan -> Token TOut :: SrcSpan -> Token TInOut :: SrcSpan -> Token TData :: SrcSpan -> Token TNamelist :: SrcSpan -> Token TImplicit :: SrcSpan -> Token TEquivalence :: SrcSpan -> Token TCommon :: SrcSpan -> Token TFormat :: SrcSpan -> Token TBlob :: SrcSpan -> String -> Token TAllocate :: SrcSpan -> Token TStat :: SrcSpan -> Token TErrMsg :: SrcSpan -> Token TSource :: SrcSpan -> Token TDeallocate :: SrcSpan -> Token TNullify :: SrcSpan -> Token TNone :: SrcSpan -> Token TGoto :: SrcSpan -> Token TAssign :: SrcSpan -> Token TTo :: SrcSpan -> Token TContinue :: SrcSpan -> Token TStop :: SrcSpan -> Token TPause :: SrcSpan -> Token TDo :: SrcSpan -> Token TEndDo :: SrcSpan -> Token TWhile :: SrcSpan -> Token TIf :: SrcSpan -> Token TThen :: SrcSpan -> Token TElse :: SrcSpan -> Token TElsif :: SrcSpan -> Token TEndIf :: SrcSpan -> Token TCase :: SrcSpan -> Token TSelectCase :: SrcSpan -> Token TEndSelect :: SrcSpan -> Token TDefault :: SrcSpan -> Token TCycle :: SrcSpan -> Token TExit :: SrcSpan -> Token TForall :: SrcSpan -> Token TEndForall :: SrcSpan -> Token TWhere :: SrcSpan -> Token TElsewhere :: SrcSpan -> Token TEndWhere :: SrcSpan -> Token TType :: SrcSpan -> Token TEndType :: SrcSpan -> Token TSequence :: SrcSpan -> Token TClass :: SrcSpan -> Token TEnum :: SrcSpan -> Token TEnumerator :: SrcSpan -> Token TEndEnum :: SrcSpan -> Token TKind :: SrcSpan -> Token TLen :: SrcSpan -> Token TInteger :: SrcSpan -> Token TReal :: SrcSpan -> Token TDoublePrecision :: SrcSpan -> Token TLogical :: SrcSpan -> Token TCharacter :: SrcSpan -> Token TComplex :: SrcSpan -> Token TOpen :: SrcSpan -> Token TClose :: SrcSpan -> Token TRead :: SrcSpan -> Token TWrite :: SrcSpan -> Token TPrint :: SrcSpan -> Token TBackspace :: SrcSpan -> Token TRewind :: SrcSpan -> Token TInquire :: SrcSpan -> Token TEndfile :: SrcSpan -> Token TEnd :: SrcSpan -> Token TNewline :: SrcSpan -> Token TEOF :: SrcSpan -> Token TFlush :: SrcSpan -> Token TUnit :: SrcSpan -> Token TIOStat :: SrcSpan -> Token TIOMsg :: SrcSpan -> Token TErr :: SrcSpan -> Token class SpecifiesType a isTypeSpec :: SpecifiesType a => a -> Bool initParseState :: ByteString -> FortranVersion -> String -> ParseState AlexInput collectFreeTokens :: FortranVersion -> ByteString -> [Token] scC :: Int scI :: Int scN :: Int scT :: Int alex_action_0 :: LexAction (Maybe Token) alex_action_1 :: LexAction (Maybe Token) alex_action_2 :: LexAction (Maybe Token) alex_action_3 :: Parse AlexInput Token (Maybe Token) alex_action_5 :: LexAction (Maybe Token) alex_action_6 :: Parse AlexInput Token (Maybe Token) alex_action_7 :: Parse AlexInput Token (Maybe Token) alex_action_8 :: LexAction (Maybe Token) alex_action_9 :: LexAction (Maybe Token) alex_action_10 :: LexAction (Maybe Token) alex_action_11 :: LexAction (Maybe Token) alex_action_12 :: LexAction (Maybe Token) alex_action_13 :: Parse AlexInput Token (Maybe Token) alex_action_14 :: LexAction (Maybe Token) alex_action_15 :: LexAction (Maybe Token) alex_action_16 :: LexAction (Maybe Token) alex_action_17 :: LexAction (Maybe Token) alex_action_18 :: LexAction (Maybe Token) alex_action_19 :: LexAction (Maybe Token) alex_action_20 :: LexAction (Maybe Token) alex_action_21 :: LexAction (Maybe Token) alex_action_22 :: LexAction (Maybe Token) alex_action_23 :: LexAction (Maybe Token) alex_action_24 :: LexAction (Maybe Token) alex_action_25 :: LexAction (Maybe Token) alex_action_26 :: LexAction (Maybe Token) alex_action_27 :: Parse AlexInput Token (Maybe Token) alex_action_28 :: Parse AlexInput Token (Maybe Token) alex_action_29 :: Parse AlexInput Token (Maybe Token) alex_action_30 :: Parse AlexInput Token (Maybe Token) alex_action_31 :: Parse AlexInput Token (Maybe Token) alex_action_32 :: Parse AlexInput Token (Maybe Token) alex_action_33 :: LexAction (Maybe Token) alex_action_34 :: LexAction (Maybe Token) alex_action_35 :: LexAction (Maybe Token) alex_action_36 :: LexAction (Maybe Token) alex_action_37 :: LexAction (Maybe Token) alex_action_38 :: LexAction (Maybe Token) alex_action_39 :: LexAction (Maybe Token) alex_action_40 :: LexAction (Maybe Token) alex_action_41 :: LexAction (Maybe Token) alex_action_42 :: LexAction (Maybe Token) alex_action_43 :: LexAction (Maybe Token) alex_action_44 :: LexAction (Maybe Token) alex_action_45 :: LexAction (Maybe Token) alex_action_46 :: LexAction (Maybe Token) alex_action_47 :: LexAction (Maybe Token) alex_action_48 :: LexAction (Maybe Token) alex_action_49 :: LexAction (Maybe Token) alex_action_50 :: LexAction (Maybe Token) alex_action_51 :: LexAction (Maybe Token) alex_action_52 :: LexAction (Maybe Token) alex_action_53 :: LexAction (Maybe Token) alex_action_54 :: LexAction (Maybe Token) alex_action_55 :: LexAction (Maybe Token) alex_action_56 :: LexAction (Maybe Token) alex_action_57 :: LexAction (Maybe Token) alex_action_58 :: LexAction (Maybe Token) alex_action_59 :: LexAction (Maybe Token) alex_action_60 :: LexAction (Maybe Token) alex_action_61 :: LexAction (Maybe Token) alex_action_62 :: LexAction (Maybe Token) alex_action_63 :: LexAction (Maybe Token) alex_action_64 :: LexAction (Maybe Token) alex_action_65 :: LexAction (Maybe Token) alex_action_66 :: LexAction (Maybe Token) alex_action_67 :: LexAction (Maybe Token) alex_action_68 :: LexAction (Maybe Token) alex_action_69 :: LexAction (Maybe Token) alex_action_70 :: LexAction (Maybe Token) alex_action_71 :: LexAction (Maybe Token) alex_action_72 :: LexAction (Maybe Token) alex_action_73 :: LexAction (Maybe Token) alex_action_74 :: LexAction (Maybe Token) alex_action_75 :: LexAction (Maybe Token) alex_action_76 :: LexAction (Maybe Token) alex_action_77 :: LexAction (Maybe Token) alex_action_78 :: LexAction (Maybe Token) alex_action_79 :: LexAction (Maybe Token) alex_action_80 :: LexAction (Maybe Token) alex_action_81 :: LexAction (Maybe Token) alex_action_82 :: LexAction (Maybe Token) alex_action_83 :: LexAction (Maybe Token) alex_action_84 :: LexAction (Maybe Token) alex_action_85 :: LexAction (Maybe Token) alex_action_86 :: LexAction (Maybe Token) alex_action_87 :: LexAction (Maybe Token) alex_action_88 :: LexAction (Maybe Token) alex_action_89 :: LexAction (Maybe Token) alex_action_90 :: LexAction (Maybe Token) alex_action_91 :: LexAction (Maybe Token) alex_action_92 :: LexAction (Maybe Token) alex_action_93 :: LexAction (Maybe Token) alex_action_94 :: LexAction (Maybe Token) alex_action_95 :: LexAction (Maybe Token) alex_action_96 :: LexAction (Maybe Token) alex_action_97 :: LexAction (Maybe Token) alex_action_98 :: LexAction (Maybe Token) alex_action_99 :: LexAction (Maybe Token) alex_action_100 :: LexAction (Maybe Token) alex_action_101 :: LexAction (Maybe Token) alex_action_102 :: LexAction (Maybe Token) alex_action_103 :: LexAction (Maybe Token) alex_action_104 :: LexAction (Maybe Token) alex_action_105 :: LexAction (Maybe Token) alex_action_106 :: LexAction (Maybe Token) alex_action_107 :: LexAction (Maybe Token) alex_action_108 :: LexAction (Maybe Token) alex_action_109 :: LexAction (Maybe Token) alex_action_110 :: LexAction (Maybe Token) alex_action_111 :: LexAction (Maybe Token) alex_action_112 :: LexAction (Maybe Token) alex_action_113 :: LexAction (Maybe Token) alex_action_114 :: LexAction (Maybe Token) alex_action_115 :: LexAction (Maybe Token) alex_action_116 :: LexAction (Maybe Token) alex_action_117 :: LexAction (Maybe Token) alex_action_118 :: LexAction (Maybe Token) alex_action_119 :: LexAction (Maybe Token) alex_action_120 :: LexAction (Maybe Token) alex_action_121 :: LexAction (Maybe Token) alex_action_122 :: LexAction (Maybe Token) alex_action_123 :: LexAction (Maybe Token) alex_action_124 :: LexAction (Maybe Token) alex_action_125 :: LexAction (Maybe Token) alex_action_126 :: LexAction (Maybe Token) alex_action_127 :: LexAction (Maybe Token) alex_action_128 :: LexAction (Maybe Token) alex_action_129 :: LexAction (Maybe Token) alex_action_130 :: LexAction (Maybe Token) alex_action_131 :: LexAction (Maybe Token) alex_action_132 :: LexAction (Maybe Token) alex_action_133 :: LexAction (Maybe Token) alex_action_134 :: LexAction (Maybe Token) alex_action_135 :: LexAction (Maybe Token) alex_action_136 :: LexAction (Maybe Token) alex_action_137 :: LexAction (Maybe Token) alex_action_138 :: LexAction (Maybe Token) alex_action_139 :: LexAction (Maybe Token) alex_action_140 :: LexAction (Maybe Token) alex_action_141 :: LexAction (Maybe Token) alex_action_142 :: LexAction (Maybe Token) alex_action_143 :: LexAction (Maybe Token) alex_action_144 :: LexAction (Maybe Token) alex_action_145 :: LexAction (Maybe Token) alex_action_146 :: LexAction (Maybe Token) alex_action_147 :: LexAction (Maybe Token) alex_action_148 :: LexAction (Maybe Token) alex_action_149 :: LexAction (Maybe Token) alex_action_150 :: LexAction (Maybe Token) alex_action_151 :: LexAction (Maybe Token) alex_action_152 :: LexAction (Maybe Token) alex_action_153 :: LexAction (Maybe Token) alex_action_154 :: LexAction (Maybe Token) alex_action_155 :: LexAction (Maybe Token) alex_action_156 :: LexAction (Maybe Token) alex_action_157 :: Parse AlexInput Token (Maybe Token) alex_action_158 :: LexAction (Maybe Token) alex_action_159 :: LexAction (Maybe Token) alex_action_160 :: LexAction (Maybe Token) alex_action_161 :: LexAction (Maybe Token) alex_action_162 :: LexAction (Maybe Token) alex_action_163 :: LexAction (Maybe Token) alex_action_164 :: LexAction (Maybe Token) alex_action_165 :: LexAction (Maybe Token) alex_action_166 :: LexAction (Maybe Token) alex_action_167 :: LexAction (Maybe Token) alex_action_168 :: LexAction (Maybe Token) alex_action_169 :: LexAction (Maybe Token) alex_action_170 :: LexAction (Maybe Token) alex_action_171 :: LexAction (Maybe Token) alex_action_172 :: LexAction (Maybe Token) alex_action_173 :: LexAction (Maybe Token) alex_action_174 :: LexAction (Maybe Token) alex_action_175 :: LexAction (Maybe Token) alex_action_176 :: LexAction (Maybe Token) alex_action_177 :: LexAction (Maybe Token) alex_action_178 :: Parse AlexInput Token (Maybe Token) alex_action_179 :: LexAction (Maybe Token) alex_action_180 :: LexAction (Maybe Token) alex_action_181 :: LexAction (Maybe Token) alex_action_182 :: LexAction (Maybe Token) alex_action_183 :: LexAction (Maybe Token) alex_action_184 :: LexAction (Maybe Token) alex_action_185 :: LexAction (Maybe Token) alex_action_186 :: LexAction (Maybe Token) alex_action_187 :: LexAction (Maybe Token) alex_action_188 :: LexAction (Maybe Token) alex_action_189 :: LexAction (Maybe Token) alex_action_190 :: LexAction (Maybe Token) alex_action_191 :: LexAction (Maybe Token) alex_action_192 :: LexAction (Maybe Token) alex_action_193 :: LexAction (Maybe Token) alex_action_194 :: LexAction (Maybe Token) alex_action_195 :: LexAction (Maybe Token) alex_action_196 :: LexAction (Maybe Token) alex_action_197 :: LexAction (Maybe Token) alex_action_198 :: LexAction (Maybe Token) alex_action_199 :: LexAction (Maybe Token) alex_action_200 :: LexAction (Maybe Token) alex_action_201 :: LexAction (Maybe Token) alex_action_202 :: LexAction (Maybe Token) alex_action_203 :: LexAction (Maybe Token) data AlexAddr AlexA# :: Addr# -> AlexAddr alexIndexInt16OffAddr :: AlexAddr -> Int# -> Int# instance GHC.Show.Show Language.Fortran.Lexer.FreeForm.Lexeme instance GHC.Show.Show Language.Fortran.Lexer.FreeForm.StartCodeStatus instance GHC.Show.Show Language.Fortran.Lexer.FreeForm.StartCode instance GHC.Generics.Generic Language.Fortran.Lexer.FreeForm.Token instance Data.Data.Data Language.Fortran.Lexer.FreeForm.Token instance GHC.Show.Show Language.Fortran.Lexer.FreeForm.Token instance GHC.Classes.Eq Language.Fortran.Lexer.FreeForm.Token instance GHC.Show.Show Language.Fortran.Lexer.FreeForm.AlexInput instance Language.Fortran.Lexer.FreeForm.SpecifiesType Language.Fortran.Lexer.FreeForm.Token instance Language.Fortran.Lexer.FreeForm.SpecifiesType [Language.Fortran.Lexer.FreeForm.Token] instance Language.Fortran.Util.Position.Loc Language.Fortran.Lexer.FreeForm.AlexInput instance Language.Fortran.ParserMonad.LastToken Language.Fortran.Lexer.FreeForm.AlexInput Language.Fortran.Lexer.FreeForm.Token instance Language.Fortran.Util.FirstParameter.FirstParameter Language.Fortran.Lexer.FreeForm.Token Language.Fortran.Util.Position.SrcSpan instance Language.Fortran.Util.FirstParameter.FirstParameter Language.Fortran.Lexer.FreeForm.Token Language.Fortran.Util.Position.SrcSpan => Language.Fortran.Util.Position.Spanned Language.Fortran.Lexer.FreeForm.Token instance Language.Fortran.ParserMonad.Tok Language.Fortran.Lexer.FreeForm.Token instance Language.Fortran.Util.Position.Spanned Language.Fortran.Lexer.FreeForm.Lexeme module Language.Fortran.Lexer.FixedForm lexer :: (Token -> LexAction a) -> LexAction a initParseState :: ByteString -> FortranVersion -> String -> ParseState AlexInput collectFixedTokens :: FortranVersion -> ByteString -> [Token] collectFixedTokensSafe :: FortranVersion -> ByteString -> Maybe [Token] data Token TLeftPar :: SrcSpan -> Token TRightPar :: SrcSpan -> Token TLeftArrayPar :: SrcSpan -> Token TRightArrayPar :: SrcSpan -> Token TComma :: SrcSpan -> Token TDot :: SrcSpan -> Token TColon :: SrcSpan -> Token TInclude :: SrcSpan -> Token TProgram :: SrcSpan -> Token TFunction :: SrcSpan -> Token TSubroutine :: SrcSpan -> Token TBlockData :: SrcSpan -> Token TStructure :: SrcSpan -> Token TRecord :: SrcSpan -> Token TUnion :: SrcSpan -> Token TMap :: SrcSpan -> Token TEndProgram :: SrcSpan -> Token TEndFunction :: SrcSpan -> Token TEndSubroutine :: SrcSpan -> Token TEndStructure :: SrcSpan -> Token TEndUnion :: SrcSpan -> Token TEndMap :: SrcSpan -> Token TEnd :: SrcSpan -> Token TAssign :: SrcSpan -> Token TOpAssign :: SrcSpan -> Token TTo :: SrcSpan -> Token TGoto :: SrcSpan -> Token TIf :: SrcSpan -> Token TThen :: SrcSpan -> Token TElse :: SrcSpan -> Token TElsif :: SrcSpan -> Token TEndif :: SrcSpan -> Token TCall :: SrcSpan -> Token TReturn :: SrcSpan -> Token TSave :: SrcSpan -> Token TContinue :: SrcSpan -> Token TStop :: SrcSpan -> Token TCycle :: SrcSpan -> Token TExit :: SrcSpan -> Token TCase :: SrcSpan -> Token TCaseDefault :: SrcSpan -> Token TSelectCase :: SrcSpan -> Token TEndSelect :: SrcSpan -> Token TPause :: SrcSpan -> Token TDo :: SrcSpan -> Token TDoWhile :: SrcSpan -> Token TWhile :: SrcSpan -> Token TEndDo :: SrcSpan -> Token TRead :: SrcSpan -> Token TWrite :: SrcSpan -> Token TRewind :: SrcSpan -> Token TBackspace :: SrcSpan -> Token TEndfile :: SrcSpan -> Token TInquire :: SrcSpan -> Token TOpen :: SrcSpan -> Token TClose :: SrcSpan -> Token TPrint :: SrcSpan -> Token TTypePrint :: SrcSpan -> Token TDimension :: SrcSpan -> Token TCommon :: SrcSpan -> Token TEquivalence :: SrcSpan -> Token TPointer :: SrcSpan -> Token TExternal :: SrcSpan -> Token TIntrinsic :: SrcSpan -> Token TType :: SrcSpan -> String -> Token TEntry :: SrcSpan -> Token TImplicit :: SrcSpan -> Token TNone :: SrcSpan -> Token TParameter :: SrcSpan -> Token TData :: SrcSpan -> Token TAutomatic :: SrcSpan -> Token TFormat :: SrcSpan -> Token TBlob :: SrcSpan -> String -> Token TInt :: SrcSpan -> String -> Token TBozInt :: SrcSpan -> String -> Token TExponent :: SrcSpan -> String -> Token TBool :: SrcSpan -> String -> Token TOpPlus :: SrcSpan -> Token TOpMinus :: SrcSpan -> Token TOpExp :: SrcSpan -> Token TStar :: SrcSpan -> Token TSlash :: SrcSpan -> Token TAmpersand :: SrcSpan -> Token TOpOr :: SrcSpan -> Token TOpAnd :: SrcSpan -> Token TOpXOr :: SrcSpan -> Token TOpNot :: SrcSpan -> Token TOpEquivalent :: SrcSpan -> Token TOpNotEquivalent :: SrcSpan -> Token TOpLT :: SrcSpan -> Token TOpLE :: SrcSpan -> Token TOpEQ :: SrcSpan -> Token TOpNE :: SrcSpan -> Token TOpGT :: SrcSpan -> Token TOpGE :: SrcSpan -> Token TId :: SrcSpan -> String -> Token TComment :: SrcSpan -> String -> Token TString :: SrcSpan -> String -> Token THollerith :: SrcSpan -> String -> Token TLabel :: SrcSpan -> String -> Token TNewline :: SrcSpan -> Token TEOF :: SrcSpan -> Token type LexAction a = Parse AlexInput Token a data AlexInput AlexInput :: ByteString -> Int -> Position -> [Word8] -> Char -> Lexeme -> Int -> Int -> Maybe Token -> [Token] -> Bool -> Bool -> FortranVersion -> AlexInput [aiSourceBytes] :: AlexInput -> ByteString [aiEndOffset] :: AlexInput -> Int [aiPosition] :: AlexInput -> Position [aiBytes] :: AlexInput -> [Word8] [aiPreviousChar] :: AlexInput -> Char [aiLexeme] :: AlexInput -> Lexeme [aiWhiteSensitiveCharCount] :: AlexInput -> Int [aiStartCode] :: AlexInput -> Int [aiPreviousToken] :: AlexInput -> Maybe Token [aiPreviousTokensInLine] :: AlexInput -> [Token] [aiCaseSensitive] :: AlexInput -> Bool [aiInFormat] :: AlexInput -> Bool [aiFortranVersion] :: AlexInput -> FortranVersion lexemeMatch :: Lexeme -> String lexN :: Int -> LexAction (Maybe String) instance GHC.Generics.Generic Language.Fortran.Lexer.FixedForm.Token instance Data.Data.Data Language.Fortran.Lexer.FixedForm.Token instance GHC.Classes.Ord Language.Fortran.Lexer.FixedForm.Token instance GHC.Classes.Eq Language.Fortran.Lexer.FixedForm.Token instance GHC.Show.Show Language.Fortran.Lexer.FixedForm.Token instance GHC.Show.Show Language.Fortran.Lexer.FixedForm.Lexeme instance GHC.Show.Show Language.Fortran.Lexer.FixedForm.AlexInput instance Language.Fortran.Util.Position.Loc Language.Fortran.Lexer.FixedForm.AlexInput instance Language.Fortran.ParserMonad.LastToken Language.Fortran.Lexer.FixedForm.AlexInput Language.Fortran.Lexer.FixedForm.Token instance Language.Fortran.Util.Position.Spanned Language.Fortran.Lexer.FixedForm.Lexeme instance Language.Fortran.Util.FirstParameter.FirstParameter Language.Fortran.Lexer.FixedForm.Token Language.Fortran.Util.Position.SrcSpan instance Language.Fortran.Util.FirstParameter.FirstParameter Language.Fortran.Lexer.FixedForm.Token Language.Fortran.Util.Position.SrcSpan => Language.Fortran.Util.Position.Spanned Language.Fortran.Lexer.FixedForm.Token instance Language.Fortran.ParserMonad.Tok Language.Fortran.Lexer.FixedForm.Token module Language.Fortran.Intrinsics -- | Obtain set of intrinsics that are most closely aligned with given -- version. getVersionIntrinsics :: FortranVersion -> IntrinsicsTable getIntrinsicReturnType :: String -> IntrinsicsTable -> Maybe IntrinsicType getIntrinsicNames :: IntrinsicsTable -> [String] getIntrinsicDefsUses :: String -> IntrinsicsTable -> Maybe ([Int], [Int]) isIntrinsic :: String -> IntrinsicsTable -> Bool data IntrinsicType ITReal :: IntrinsicType ITInteger :: IntrinsicType ITComplex :: IntrinsicType ITDouble :: IntrinsicType ITLogical :: IntrinsicType ITCharacter :: IntrinsicType ITParam :: Int -> IntrinsicType type IntrinsicsTable = Map String IntrinsicsEntry allIntrinsics :: IntrinsicsTable instance GHC.Generics.Generic Language.Fortran.Intrinsics.IntrinsicType instance GHC.Classes.Ord Language.Fortran.Intrinsics.IntrinsicType instance GHC.Classes.Eq Language.Fortran.Intrinsics.IntrinsicType instance GHC.Show.Show Language.Fortran.Intrinsics.IntrinsicType instance GHC.Generics.Generic Language.Fortran.Intrinsics.IntrinsicsEntry instance GHC.Classes.Ord Language.Fortran.Intrinsics.IntrinsicsEntry instance GHC.Classes.Eq Language.Fortran.Intrinsics.IntrinsicsEntry instance GHC.Show.Show Language.Fortran.Intrinsics.IntrinsicsEntry module Language.Fortran.AST type A0 = () type Name = String data AList t a AList :: a -> SrcSpan -> [t a] -> AList t a fromList :: Spanned (t a) => a -> [t a] -> AList t a fromList' :: Spanned (t a) => a -> [t a] -> Maybe (AList t a) fromReverseList :: Spanned (t ()) => [t ()] -> AList t () fromReverseList' :: Spanned (t ()) => [t ()] -> Maybe (AList t ()) aCons :: t a -> AList t a -> AList t a infixr 5 `aCons` aReverse :: AList t a -> AList t a aStrip :: AList t a -> [t a] aStrip' :: Maybe (AList t a) -> [t a] aMap :: (t a -> r a) -> AList t a -> AList r a data BaseType TypeInteger :: BaseType TypeReal :: BaseType TypeDoublePrecision :: BaseType TypeComplex :: BaseType TypeDoubleComplex :: BaseType TypeLogical :: BaseType -- | len and kind, if specified TypeCharacter :: Maybe CharacterLen -> Maybe String -> BaseType TypeCustom :: String -> BaseType ClassStar :: BaseType ClassCustom :: String -> BaseType TypeByte :: BaseType data CharacterLen -- | specified with a * CharLenStar :: CharacterLen -- | specified with a : (Fortran2003) FIXME, possibly, with a more robust -- const-exp: CharLenColon :: CharacterLen -- | specified with a non-trivial expression CharLenExp :: CharacterLen -- | specified with a constant integer CharLenInt :: Int -> CharacterLen charLenSelector :: Maybe (Selector a) -> (Maybe CharacterLen, Maybe String) data TypeSpec a TypeSpec :: a -> SrcSpan -> BaseType -> Maybe (Selector a) -> TypeSpec a data Selector a Selector :: a -> SrcSpan -> Maybe (Expression a) -> Maybe (Expression a) -> Selector a data MetaInfo MetaInfo :: FortranVersion -> String -> MetaInfo [miVersion] :: MetaInfo -> FortranVersion [miFilename] :: MetaInfo -> String data ProgramFile a ProgramFile :: MetaInfo -> [ProgramUnit a] -> ProgramFile a pfSetFilename :: String -> ProgramFile a -> ProgramFile a pfGetFilename :: ProgramFile a -> String data ProgramUnit a PUMain :: a -> SrcSpan -> Maybe Name -> [Block a] -> Maybe [ProgramUnit a] -> ProgramUnit a PUModule :: a -> SrcSpan -> Name -> [Block a] -> Maybe [ProgramUnit a] -> ProgramUnit a PUSubroutine :: a -> SrcSpan -> PrefixSuffix a -> Name -> Maybe (AList Expression a) -> [Block a] -> Maybe [ProgramUnit a] -> ProgramUnit a PUFunction :: a -> SrcSpan -> Maybe (TypeSpec a) -> PrefixSuffix a -> Name -> Maybe (AList Expression a) -> Maybe (Expression a) -> [Block a] -> Maybe [ProgramUnit a] -> ProgramUnit a PUBlockData :: a -> SrcSpan -> Maybe Name -> [Block a] -> ProgramUnit a PUComment :: a -> SrcSpan -> Comment a -> ProgramUnit a type Prefixes a = Maybe (AList Prefix a) type Suffixes a = Maybe (AList Suffix a) type PrefixSuffix a = (Prefixes a, Suffixes a) emptyPrefixes :: Prefixes a emptySuffixes :: Suffixes a emptyPrefixSuffix :: PrefixSuffix a data Prefix a PfxRecursive :: a -> SrcSpan -> Prefix a PfxElemental :: a -> SrcSpan -> Prefix a PfxPure :: a -> SrcSpan -> Prefix a validPrefixSuffix :: PrefixSuffix a -> Bool data Suffix a SfxBind :: a -> SrcSpan -> Maybe (Expression a) -> Suffix a programUnitBody :: ProgramUnit a -> [Block a] updateProgramUnitBody :: ProgramUnit a -> [Block a] -> ProgramUnit a programUnitSubprograms :: ProgramUnit a -> Maybe [ProgramUnit a] newtype Comment a Comment :: String -> Comment a data Block a BlStatement :: a -> SrcSpan -> Maybe (Expression a) -> Statement a -> Block a BlForall :: a -> SrcSpan -> Maybe (Expression a) -> Maybe String -> ForallHeader a -> [Block a] -> Maybe (Expression a) -> Block a BlIf :: a -> SrcSpan -> Maybe (Expression a) -> Maybe String -> [Maybe (Expression a)] -> [[Block a]] -> Maybe (Expression a) -> Block a BlCase :: a -> SrcSpan -> Maybe (Expression a) -> Maybe String -> Expression a -> [Maybe (AList Index a)] -> [[Block a]] -> Maybe (Expression a) -> Block a BlDo :: a -> SrcSpan -> Maybe (Expression a) -> Maybe String -> Maybe (Expression a) -> Maybe (DoSpecification a) -> [Block a] -> Maybe (Expression a) -> Block a BlDoWhile :: a -> SrcSpan -> Maybe (Expression a) -> Maybe String -> Maybe (Expression a) -> Expression a -> [Block a] -> Maybe (Expression a) -> Block a BlInterface :: a -> SrcSpan -> Maybe (Expression a) -> Bool -> [ProgramUnit a] -> [Block a] -> Block a BlComment :: a -> SrcSpan -> Comment a -> Block a data Statement a StDeclaration :: a -> SrcSpan -> TypeSpec a -> Maybe (AList Attribute a) -> AList Declarator a -> Statement a StStructure :: a -> SrcSpan -> Maybe String -> AList StructureItem a -> Statement a StIntent :: a -> SrcSpan -> Intent -> AList Expression a -> Statement a StOptional :: a -> SrcSpan -> AList Expression a -> Statement a StPublic :: a -> SrcSpan -> Maybe (AList Expression a) -> Statement a StPrivate :: a -> SrcSpan -> Maybe (AList Expression a) -> Statement a StProtected :: a -> SrcSpan -> Maybe (AList Expression a) -> Statement a StSave :: a -> SrcSpan -> Maybe (AList Expression a) -> Statement a StDimension :: a -> SrcSpan -> AList Declarator a -> Statement a StAllocatable :: a -> SrcSpan -> AList Declarator a -> Statement a StAsynchronous :: a -> SrcSpan -> AList Declarator a -> Statement a StPointer :: a -> SrcSpan -> AList Declarator a -> Statement a StTarget :: a -> SrcSpan -> AList Declarator a -> Statement a StValue :: a -> SrcSpan -> AList Declarator a -> Statement a StVolatile :: a -> SrcSpan -> AList Declarator a -> Statement a StData :: a -> SrcSpan -> AList DataGroup a -> Statement a StAutomatic :: a -> SrcSpan -> AList Declarator a -> Statement a StNamelist :: a -> SrcSpan -> AList Namelist a -> Statement a StParameter :: a -> SrcSpan -> AList Declarator a -> Statement a StExternal :: a -> SrcSpan -> AList Expression a -> Statement a StIntrinsic :: a -> SrcSpan -> AList Expression a -> Statement a StCommon :: a -> SrcSpan -> AList CommonGroup a -> Statement a StEquivalence :: a -> SrcSpan -> AList (AList Expression) a -> Statement a StFormat :: a -> SrcSpan -> AList FormatItem a -> Statement a StImplicit :: a -> SrcSpan -> Maybe (AList ImpList a) -> Statement a StEntry :: a -> SrcSpan -> Expression a -> Maybe (AList Expression a) -> Maybe (Expression a) -> Statement a StInclude :: a -> SrcSpan -> Expression a -> Maybe [Block a] -> Statement a StDo :: a -> SrcSpan -> Maybe String -> Maybe (Expression a) -> Maybe (DoSpecification a) -> Statement a StDoWhile :: a -> SrcSpan -> Maybe String -> Maybe (Expression a) -> Expression a -> Statement a StEnddo :: a -> SrcSpan -> Maybe String -> Statement a StCycle :: a -> SrcSpan -> Maybe (Expression a) -> Statement a StExit :: a -> SrcSpan -> Maybe (Expression a) -> Statement a StIfLogical :: a -> SrcSpan -> Expression a -> Statement a -> Statement a StIfArithmetic :: a -> SrcSpan -> Expression a -> Expression a -> Expression a -> Expression a -> Statement a StIfThen :: a -> SrcSpan -> Maybe String -> Expression a -> Statement a StElse :: a -> SrcSpan -> Maybe String -> Statement a StElsif :: a -> SrcSpan -> Maybe String -> Expression a -> Statement a StEndif :: a -> SrcSpan -> Maybe String -> Statement a StSelectCase :: a -> SrcSpan -> Maybe String -> Expression a -> Statement a StCase :: a -> SrcSpan -> Maybe String -> Maybe (AList Index a) -> Statement a StEndcase :: a -> SrcSpan -> Maybe String -> Statement a StFunction :: a -> SrcSpan -> Expression a -> AList Expression a -> Expression a -> Statement a StExpressionAssign :: a -> SrcSpan -> Expression a -> Expression a -> Statement a StPointerAssign :: a -> SrcSpan -> Expression a -> Expression a -> Statement a StLabelAssign :: a -> SrcSpan -> Expression a -> Expression a -> Statement a StGotoUnconditional :: a -> SrcSpan -> Expression a -> Statement a StGotoAssigned :: a -> SrcSpan -> Expression a -> Maybe (AList Expression a) -> Statement a StGotoComputed :: a -> SrcSpan -> AList Expression a -> Expression a -> Statement a StCall :: a -> SrcSpan -> Expression a -> Maybe (AList Argument a) -> Statement a StReturn :: a -> SrcSpan -> Maybe (Expression a) -> Statement a StContinue :: a -> SrcSpan -> Statement a StStop :: a -> SrcSpan -> Maybe (Expression a) -> Statement a StPause :: a -> SrcSpan -> Maybe (Expression a) -> Statement a StRead :: a -> SrcSpan -> AList ControlPair a -> Maybe (AList Expression a) -> Statement a StRead2 :: a -> SrcSpan -> Expression a -> Maybe (AList Expression a) -> Statement a StWrite :: a -> SrcSpan -> AList ControlPair a -> Maybe (AList Expression a) -> Statement a StPrint :: a -> SrcSpan -> Expression a -> Maybe (AList Expression a) -> Statement a StTypePrint :: a -> SrcSpan -> Expression a -> Maybe (AList Expression a) -> Statement a StOpen :: a -> SrcSpan -> AList ControlPair a -> Statement a StClose :: a -> SrcSpan -> AList ControlPair a -> Statement a StFlush :: a -> SrcSpan -> AList FlushSpec a -> Statement a StInquire :: a -> SrcSpan -> AList ControlPair a -> Statement a StRewind :: a -> SrcSpan -> AList ControlPair a -> Statement a StRewind2 :: a -> SrcSpan -> Expression a -> Statement a StBackspace :: a -> SrcSpan -> AList ControlPair a -> Statement a StBackspace2 :: a -> SrcSpan -> Expression a -> Statement a StEndfile :: a -> SrcSpan -> AList ControlPair a -> Statement a StEndfile2 :: a -> SrcSpan -> Expression a -> Statement a StAllocate :: a -> SrcSpan -> Maybe (TypeSpec a) -> AList Expression a -> Maybe (AList AllocOpt a) -> Statement a StNullify :: a -> SrcSpan -> AList Expression a -> Statement a StDeallocate :: a -> SrcSpan -> AList Expression a -> Maybe (AList AllocOpt a) -> Statement a StWhere :: a -> SrcSpan -> Expression a -> Statement a -> Statement a StWhereConstruct :: a -> SrcSpan -> Maybe String -> Expression a -> Statement a StElsewhere :: a -> SrcSpan -> Maybe String -> Maybe (Expression a) -> Statement a StEndWhere :: a -> SrcSpan -> Maybe String -> Statement a StUse :: a -> SrcSpan -> Expression a -> Maybe ModuleNature -> Only -> Maybe (AList Use a) -> Statement a StModuleProcedure :: a -> SrcSpan -> AList Expression a -> Statement a StProcedure :: a -> SrcSpan -> Maybe (ProcInterface a) -> Maybe (Attribute a) -> AList ProcDecl a -> Statement a StType :: a -> SrcSpan -> Maybe (AList Attribute a) -> String -> Statement a StEndType :: a -> SrcSpan -> Maybe String -> Statement a StSequence :: a -> SrcSpan -> Statement a StForall :: a -> SrcSpan -> Maybe String -> ForallHeader a -> Statement a StForallStatement :: a -> SrcSpan -> ForallHeader a -> Statement a -> Statement a StEndForall :: a -> SrcSpan -> Maybe String -> Statement a StImport :: a -> SrcSpan -> AList Expression a -> Statement a StEnum :: a -> SrcSpan -> Statement a StEnumerator :: a -> SrcSpan -> AList Declarator a -> Statement a StEndEnum :: a -> SrcSpan -> Statement a StFormatBogus :: a -> SrcSpan -> String -> Statement a data ProcDecl a ProcDecl :: a -> SrcSpan -> Expression a -> Maybe (Expression a) -> ProcDecl a data ProcInterface a ProcInterfaceName :: a -> SrcSpan -> Expression a -> ProcInterface a ProcInterfaceType :: a -> SrcSpan -> TypeSpec a -> ProcInterface a data ForallHeader a ForallHeader :: [(Name, Expression a, Expression a, Maybe (Expression a))] -> Maybe (Expression a) -> ForallHeader a data Only Exclusive :: Only Permissive :: Only data ModuleNature ModIntrinsic :: ModuleNature ModNonIntrinsic :: ModuleNature data Use a UseRename :: a -> SrcSpan -> Expression a -> Expression a -> Use a UseID :: a -> SrcSpan -> Expression a -> Use a data Argument a Argument :: a -> SrcSpan -> Maybe String -> Expression a -> Argument a data Attribute a AttrAllocatable :: a -> SrcSpan -> Attribute a AttrAsynchronous :: a -> SrcSpan -> Attribute a AttrDimension :: a -> SrcSpan -> AList DimensionDeclarator a -> Attribute a AttrExternal :: a -> SrcSpan -> Attribute a AttrIntent :: a -> SrcSpan -> Intent -> Attribute a AttrIntrinsic :: a -> SrcSpan -> Attribute a AttrOptional :: a -> SrcSpan -> Attribute a AttrParameter :: a -> SrcSpan -> Attribute a AttrPointer :: a -> SrcSpan -> Attribute a AttrPrivate :: a -> SrcSpan -> Attribute a AttrProtected :: a -> SrcSpan -> Attribute a AttrPublic :: a -> SrcSpan -> Attribute a AttrSave :: a -> SrcSpan -> Attribute a AttrSuffix :: a -> SrcSpan -> Suffix a -> Attribute a AttrTarget :: a -> SrcSpan -> Attribute a AttrValue :: a -> SrcSpan -> Attribute a AttrVolatile :: a -> SrcSpan -> Attribute a data Intent In :: Intent Out :: Intent InOut :: Intent data ControlPair a ControlPair :: a -> SrcSpan -> Maybe String -> Expression a -> ControlPair a data AllocOpt a AOStat :: a -> SrcSpan -> Expression a -> AllocOpt a AOErrMsg :: a -> SrcSpan -> Expression a -> AllocOpt a AOSource :: a -> SrcSpan -> Expression a -> AllocOpt a data ImpList a ImpList :: a -> SrcSpan -> TypeSpec a -> AList ImpElement a -> ImpList a data ImpElement a ImpCharacter :: a -> SrcSpan -> String -> ImpElement a ImpRange :: a -> SrcSpan -> String -> String -> ImpElement a data CommonGroup a CommonGroup :: a -> SrcSpan -> Maybe (Expression a) -> AList Expression a -> CommonGroup a data Namelist a Namelist :: a -> SrcSpan -> Expression a -> AList Expression a -> Namelist a data DataGroup a DataGroup :: a -> SrcSpan -> AList Expression a -> AList Expression a -> DataGroup a data StructureItem a StructFields :: a -> SrcSpan -> TypeSpec a -> Maybe (AList Attribute a) -> AList Declarator a -> StructureItem a StructUnion :: a -> SrcSpan -> AList UnionMap a -> StructureItem a StructStructure :: a -> SrcSpan -> Maybe String -> String -> AList StructureItem a -> StructureItem a data UnionMap a UnionMap :: a -> SrcSpan -> AList StructureItem a -> UnionMap a data FormatItem a FIFormatList :: a -> SrcSpan -> Maybe String -> AList FormatItem a -> FormatItem a FIHollerith :: a -> SrcSpan -> Value a -> FormatItem a FIDelimiter :: a -> SrcSpan -> FormatItem a FIFieldDescriptorDEFG :: a -> SrcSpan -> Maybe Integer -> Char -> Integer -> Integer -> FormatItem a FIFieldDescriptorAIL :: a -> SrcSpan -> Maybe Integer -> Char -> Integer -> FormatItem a FIBlankDescriptor :: a -> SrcSpan -> Integer -> FormatItem a FIScaleFactor :: a -> SrcSpan -> Integer -> FormatItem a data FlushSpec a FSUnit :: a -> SrcSpan -> Expression a -> FlushSpec a FSIOStat :: a -> SrcSpan -> Expression a -> FlushSpec a FSIOMsg :: a -> SrcSpan -> Expression a -> FlushSpec a FSErr :: a -> SrcSpan -> Expression a -> FlushSpec a data DoSpecification a DoSpecification :: a -> SrcSpan -> Statement a -> Expression a -> Maybe (Expression a) -> DoSpecification a data Expression a -- | Use a value as an expression. ExpValue :: a -> SrcSpan -> Value a -> Expression a -- | A binary operator applied to two expressions. ExpBinary :: a -> SrcSpan -> BinaryOp -> Expression a -> Expression a -> Expression a -- | A unary operator applied to two expressions. ExpUnary :: a -> SrcSpan -> UnaryOp -> Expression a -> Expression a -- | Array indexing ExpSubscript :: a -> SrcSpan -> Expression a -> AList Index a -> Expression a -- | % notation for variables inside data types ExpDataRef :: a -> SrcSpan -> Expression a -> Expression a -> Expression a -- | A function expression applied to a list of arguments. ExpFunctionCall :: a -> SrcSpan -> Expression a -> Maybe (AList Argument a) -> Expression a -- | Implied do (i.e. one-liner do loops) ExpImpliedDo :: a -> SrcSpan -> AList Expression a -> DoSpecification a -> Expression a -- | Array initialisation ExpInitialisation :: a -> SrcSpan -> AList Expression a -> Expression a -- | Function return value specification ExpReturnSpec :: a -> SrcSpan -> Expression a -> Expression a data Index a IxSingle :: a -> SrcSpan -> Maybe String -> Expression a -> Index a IxRange :: a -> SrcSpan -> Maybe (Expression a) -> Maybe (Expression a) -> Maybe (Expression a) -> Index a data Value a -- | The string representation of an integer literal ValInteger :: String -> Value a -- | The string representation of a real literal ValReal :: String -> Value a -- | The real and imaginary parts of a complex value ValComplex :: Expression a -> Expression a -> Value a -- | A string literal ValString :: String -> Value a -- | A Hollerith literal ValHollerith :: String -> Value a -- | The name of a variable ValVariable :: Name -> Value a -- | The name of a built-in function ValIntrinsic :: Name -> Value a -- | A boolean value ValLogical :: String -> Value a -- | User-defined operators in interfaces ValOperator :: String -> Value a -- | Overloaded assignment in interfaces ValAssignment :: Value a ValType :: String -> Value a ValStar :: Value a ValColon :: Value a data Declarator a DeclVariable :: a -> SrcSpan -> Expression a -> Maybe (Expression a) -> Maybe (Expression a) -> Declarator a DeclArray :: a -> SrcSpan -> Expression a -> AList DimensionDeclarator a -> Maybe (Expression a) -> Maybe (Expression a) -> Declarator a setInitialisation :: Declarator a -> Expression a -> Declarator a data DimensionDeclarator a DimensionDeclarator :: a -> SrcSpan -> Maybe (Expression a) -> Maybe (Expression a) -> DimensionDeclarator a data UnaryOp Plus :: UnaryOp Minus :: UnaryOp Not :: UnaryOp UnCustom :: String -> UnaryOp data BinaryOp Addition :: BinaryOp Subtraction :: BinaryOp Multiplication :: BinaryOp Division :: BinaryOp Exponentiation :: BinaryOp Concatenation :: BinaryOp GT :: BinaryOp GTE :: BinaryOp LT :: BinaryOp LTE :: BinaryOp EQ :: BinaryOp NE :: BinaryOp Or :: BinaryOp XOr :: BinaryOp And :: BinaryOp Equivalent :: BinaryOp NotEquivalent :: BinaryOp BinCustom :: String -> BinaryOp class Annotated f getAnnotation :: Annotated f => f a -> a setAnnotation :: Annotated f => a -> f a -> f a modifyAnnotation :: Annotated f => (a -> a) -> f a -> f a getAnnotation :: (Annotated f, FirstParameter (f a) a) => f a -> a setAnnotation :: (Annotated f, FirstParameter (f a) a) => a -> f a -> f a class (Spanned a, Spanned b) => SpannedPair a b getTransSpan :: SpannedPair a b => a -> b -> SrcSpan class Labeled f getLabel :: Labeled f => f a -> Maybe (Expression a) getLastLabel :: Labeled f => f a -> Maybe (Expression a) setLabel :: Labeled f => f a -> Expression a -> f a class Conditioned f getCondition :: Conditioned f => f a -> Maybe (Expression a) data ProgramUnitName Named :: String -> ProgramUnitName NamelessBlockData :: ProgramUnitName NamelessComment :: ProgramUnitName NamelessMain :: ProgramUnitName class Named a getName :: Named a => a -> ProgramUnitName setName :: Named a => ProgramUnitName -> a -> a nonExecutableStatement :: FortranVersion -> Statement a -> Bool executableStatement :: FortranVersion -> Statement a -> Bool executableStatementBlock :: FortranVersion -> Block a -> Bool nonExecutableStatementBlock :: FortranVersion -> Block a -> Bool instance GHC.Generics.Generic (Language.Fortran.AST.AList t a) instance (Data.Typeable.Internal.Typeable t, Data.Data.Data a, Data.Data.Data (t a)) => Data.Data.Data (Language.Fortran.AST.AList t a) instance (GHC.Show.Show a, GHC.Show.Show (t a)) => GHC.Show.Show (Language.Fortran.AST.AList t a) instance (GHC.Classes.Eq a, GHC.Classes.Eq (t a)) => GHC.Classes.Eq (Language.Fortran.AST.AList t a) instance GHC.Generics.Generic Language.Fortran.AST.CharacterLen instance Data.Data.Data Language.Fortran.AST.CharacterLen instance GHC.Show.Show Language.Fortran.AST.CharacterLen instance GHC.Classes.Eq Language.Fortran.AST.CharacterLen instance GHC.Classes.Ord Language.Fortran.AST.CharacterLen instance GHC.Generics.Generic Language.Fortran.AST.BaseType instance Data.Data.Data Language.Fortran.AST.BaseType instance GHC.Show.Show Language.Fortran.AST.BaseType instance GHC.Classes.Eq Language.Fortran.AST.BaseType instance GHC.Classes.Ord Language.Fortran.AST.BaseType instance GHC.Generics.Generic Language.Fortran.AST.MetaInfo instance Data.Data.Data Language.Fortran.AST.MetaInfo instance GHC.Show.Show Language.Fortran.AST.MetaInfo instance GHC.Classes.Eq Language.Fortran.AST.MetaInfo instance GHC.Base.Functor Language.Fortran.AST.Prefix instance GHC.Generics.Generic (Language.Fortran.AST.Prefix a) instance Data.Data.Data a => Data.Data.Data (Language.Fortran.AST.Prefix a) instance GHC.Show.Show a => GHC.Show.Show (Language.Fortran.AST.Prefix a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Language.Fortran.AST.Prefix a) instance GHC.Base.Functor Language.Fortran.AST.Comment instance GHC.Generics.Generic (Language.Fortran.AST.Comment a) instance Data.Data.Data a => Data.Data.Data (Language.Fortran.AST.Comment a) instance GHC.Show.Show (Language.Fortran.AST.Comment a) instance GHC.Classes.Eq (Language.Fortran.AST.Comment a) instance GHC.Generics.Generic Language.Fortran.AST.Only instance Data.Data.Data Language.Fortran.AST.Only instance GHC.Show.Show Language.Fortran.AST.Only instance GHC.Classes.Eq Language.Fortran.AST.Only instance GHC.Generics.Generic Language.Fortran.AST.ModuleNature instance Data.Data.Data Language.Fortran.AST.ModuleNature instance GHC.Show.Show Language.Fortran.AST.ModuleNature instance GHC.Classes.Eq Language.Fortran.AST.ModuleNature instance GHC.Generics.Generic Language.Fortran.AST.Intent instance Data.Data.Data Language.Fortran.AST.Intent instance GHC.Show.Show Language.Fortran.AST.Intent instance GHC.Classes.Eq Language.Fortran.AST.Intent instance GHC.Base.Functor Language.Fortran.AST.ImpElement instance GHC.Generics.Generic (Language.Fortran.AST.ImpElement a) instance Data.Data.Data a => Data.Data.Data (Language.Fortran.AST.ImpElement a) instance GHC.Show.Show a => GHC.Show.Show (Language.Fortran.AST.ImpElement a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Language.Fortran.AST.ImpElement a) instance GHC.Generics.Generic Language.Fortran.AST.UnaryOp instance Data.Data.Data Language.Fortran.AST.UnaryOp instance GHC.Show.Show Language.Fortran.AST.UnaryOp instance GHC.Classes.Ord Language.Fortran.AST.UnaryOp instance GHC.Classes.Eq Language.Fortran.AST.UnaryOp instance GHC.Generics.Generic Language.Fortran.AST.BinaryOp instance Data.Data.Data Language.Fortran.AST.BinaryOp instance GHC.Show.Show Language.Fortran.AST.BinaryOp instance GHC.Classes.Ord Language.Fortran.AST.BinaryOp instance GHC.Classes.Eq Language.Fortran.AST.BinaryOp instance GHC.Base.Functor Language.Fortran.AST.ProgramUnit instance GHC.Generics.Generic (Language.Fortran.AST.ProgramUnit a) instance Data.Data.Data a => Data.Data.Data (Language.Fortran.AST.ProgramUnit a) instance GHC.Show.Show a => GHC.Show.Show (Language.Fortran.AST.ProgramUnit a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Language.Fortran.AST.ProgramUnit a) instance GHC.Base.Functor Language.Fortran.AST.Block instance GHC.Generics.Generic (Language.Fortran.AST.Block a) instance Data.Data.Data a => Data.Data.Data (Language.Fortran.AST.Block a) instance GHC.Show.Show a => GHC.Show.Show (Language.Fortran.AST.Block a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Language.Fortran.AST.Block a) instance GHC.Base.Functor Language.Fortran.AST.ProcDecl instance GHC.Generics.Generic (Language.Fortran.AST.ProcDecl a) instance Data.Data.Data a => Data.Data.Data (Language.Fortran.AST.ProcDecl a) instance GHC.Show.Show a => GHC.Show.Show (Language.Fortran.AST.ProcDecl a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Language.Fortran.AST.ProcDecl a) instance GHC.Base.Functor Language.Fortran.AST.ProcInterface instance GHC.Generics.Generic (Language.Fortran.AST.ProcInterface a) instance Data.Data.Data a => Data.Data.Data (Language.Fortran.AST.ProcInterface a) instance GHC.Show.Show a => GHC.Show.Show (Language.Fortran.AST.ProcInterface a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Language.Fortran.AST.ProcInterface a) instance GHC.Base.Functor Language.Fortran.AST.ForallHeader instance GHC.Generics.Generic (Language.Fortran.AST.ForallHeader a) instance Data.Data.Data a => Data.Data.Data (Language.Fortran.AST.ForallHeader a) instance GHC.Show.Show a => GHC.Show.Show (Language.Fortran.AST.ForallHeader a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Language.Fortran.AST.ForallHeader a) instance GHC.Base.Functor Language.Fortran.AST.Use instance GHC.Generics.Generic (Language.Fortran.AST.Use a) instance Data.Data.Data a => Data.Data.Data (Language.Fortran.AST.Use a) instance GHC.Show.Show a => GHC.Show.Show (Language.Fortran.AST.Use a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Language.Fortran.AST.Use a) instance GHC.Base.Functor Language.Fortran.AST.Argument instance GHC.Generics.Generic (Language.Fortran.AST.Argument a) instance Data.Data.Data a => Data.Data.Data (Language.Fortran.AST.Argument a) instance GHC.Show.Show a => GHC.Show.Show (Language.Fortran.AST.Argument a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Language.Fortran.AST.Argument a) instance GHC.Base.Functor Language.Fortran.AST.ControlPair instance GHC.Generics.Generic (Language.Fortran.AST.ControlPair a) instance Data.Data.Data a => Data.Data.Data (Language.Fortran.AST.ControlPair a) instance GHC.Show.Show a => GHC.Show.Show (Language.Fortran.AST.ControlPair a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Language.Fortran.AST.ControlPair a) instance GHC.Base.Functor Language.Fortran.AST.AllocOpt instance GHC.Generics.Generic (Language.Fortran.AST.AllocOpt a) instance Data.Data.Data a => Data.Data.Data (Language.Fortran.AST.AllocOpt a) instance GHC.Show.Show a => GHC.Show.Show (Language.Fortran.AST.AllocOpt a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Language.Fortran.AST.AllocOpt a) instance GHC.Base.Functor Language.Fortran.AST.ImpList instance GHC.Generics.Generic (Language.Fortran.AST.ImpList a) instance Data.Data.Data a => Data.Data.Data (Language.Fortran.AST.ImpList a) instance GHC.Show.Show a => GHC.Show.Show (Language.Fortran.AST.ImpList a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Language.Fortran.AST.ImpList a) instance GHC.Base.Functor Language.Fortran.AST.CommonGroup instance GHC.Generics.Generic (Language.Fortran.AST.CommonGroup a) instance Data.Data.Data a => Data.Data.Data (Language.Fortran.AST.CommonGroup a) instance GHC.Show.Show a => GHC.Show.Show (Language.Fortran.AST.CommonGroup a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Language.Fortran.AST.CommonGroup a) instance GHC.Base.Functor Language.Fortran.AST.Namelist instance GHC.Generics.Generic (Language.Fortran.AST.Namelist a) instance Data.Data.Data a => Data.Data.Data (Language.Fortran.AST.Namelist a) instance GHC.Show.Show a => GHC.Show.Show (Language.Fortran.AST.Namelist a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Language.Fortran.AST.Namelist a) instance GHC.Base.Functor Language.Fortran.AST.DataGroup instance GHC.Generics.Generic (Language.Fortran.AST.DataGroup a) instance Data.Data.Data a => Data.Data.Data (Language.Fortran.AST.DataGroup a) instance GHC.Show.Show a => GHC.Show.Show (Language.Fortran.AST.DataGroup a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Language.Fortran.AST.DataGroup a) instance GHC.Base.Functor Language.Fortran.AST.Selector instance GHC.Generics.Generic (Language.Fortran.AST.Selector a) instance Data.Data.Data a => Data.Data.Data (Language.Fortran.AST.Selector a) instance GHC.Show.Show a => GHC.Show.Show (Language.Fortran.AST.Selector a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Language.Fortran.AST.Selector a) instance GHC.Base.Functor Language.Fortran.AST.TypeSpec instance GHC.Generics.Generic (Language.Fortran.AST.TypeSpec a) instance Data.Data.Data a => Data.Data.Data (Language.Fortran.AST.TypeSpec a) instance GHC.Show.Show a => GHC.Show.Show (Language.Fortran.AST.TypeSpec a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Language.Fortran.AST.TypeSpec a) instance GHC.Base.Functor Language.Fortran.AST.Suffix instance GHC.Generics.Generic (Language.Fortran.AST.Suffix a) instance Data.Data.Data a => Data.Data.Data (Language.Fortran.AST.Suffix a) instance GHC.Show.Show a => GHC.Show.Show (Language.Fortran.AST.Suffix a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Language.Fortran.AST.Suffix a) instance GHC.Base.Functor Language.Fortran.AST.Attribute instance GHC.Generics.Generic (Language.Fortran.AST.Attribute a) instance Data.Data.Data a => Data.Data.Data (Language.Fortran.AST.Attribute a) instance GHC.Show.Show a => GHC.Show.Show (Language.Fortran.AST.Attribute a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Language.Fortran.AST.Attribute a) instance GHC.Base.Functor Language.Fortran.AST.UnionMap instance GHC.Generics.Generic (Language.Fortran.AST.UnionMap a) instance Data.Data.Data a => Data.Data.Data (Language.Fortran.AST.UnionMap a) instance GHC.Show.Show a => GHC.Show.Show (Language.Fortran.AST.UnionMap a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Language.Fortran.AST.UnionMap a) instance GHC.Base.Functor Language.Fortran.AST.StructureItem instance GHC.Generics.Generic (Language.Fortran.AST.StructureItem a) instance Data.Data.Data a => Data.Data.Data (Language.Fortran.AST.StructureItem a) instance GHC.Show.Show a => GHC.Show.Show (Language.Fortran.AST.StructureItem a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Language.Fortran.AST.StructureItem a) instance GHC.Base.Functor Language.Fortran.AST.FormatItem instance GHC.Generics.Generic (Language.Fortran.AST.FormatItem a) instance Data.Data.Data a => Data.Data.Data (Language.Fortran.AST.FormatItem a) instance GHC.Show.Show a => GHC.Show.Show (Language.Fortran.AST.FormatItem a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Language.Fortran.AST.FormatItem a) instance GHC.Base.Functor Language.Fortran.AST.FlushSpec instance GHC.Generics.Generic (Language.Fortran.AST.FlushSpec a) instance Data.Data.Data a => Data.Data.Data (Language.Fortran.AST.FlushSpec a) instance GHC.Show.Show a => GHC.Show.Show (Language.Fortran.AST.FlushSpec a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Language.Fortran.AST.FlushSpec a) instance GHC.Base.Functor Language.Fortran.AST.DimensionDeclarator instance GHC.Generics.Generic (Language.Fortran.AST.DimensionDeclarator a) instance Data.Data.Data a => Data.Data.Data (Language.Fortran.AST.DimensionDeclarator a) instance GHC.Show.Show a => GHC.Show.Show (Language.Fortran.AST.DimensionDeclarator a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Language.Fortran.AST.DimensionDeclarator a) instance GHC.Base.Functor Language.Fortran.AST.Declarator instance GHC.Generics.Generic (Language.Fortran.AST.Declarator a) instance Data.Data.Data a => Data.Data.Data (Language.Fortran.AST.Declarator a) instance GHC.Show.Show a => GHC.Show.Show (Language.Fortran.AST.Declarator a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Language.Fortran.AST.Declarator a) instance GHC.Base.Functor Language.Fortran.AST.Statement instance GHC.Generics.Generic (Language.Fortran.AST.Statement a) instance Data.Data.Data a => Data.Data.Data (Language.Fortran.AST.Statement a) instance GHC.Show.Show a => GHC.Show.Show (Language.Fortran.AST.Statement a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Language.Fortran.AST.Statement a) instance GHC.Base.Functor Language.Fortran.AST.DoSpecification instance GHC.Generics.Generic (Language.Fortran.AST.DoSpecification a) instance Data.Data.Data a => Data.Data.Data (Language.Fortran.AST.DoSpecification a) instance GHC.Show.Show a => GHC.Show.Show (Language.Fortran.AST.DoSpecification a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Language.Fortran.AST.DoSpecification a) instance GHC.Base.Functor Language.Fortran.AST.Index instance GHC.Generics.Generic (Language.Fortran.AST.Index a) instance Data.Data.Data a => Data.Data.Data (Language.Fortran.AST.Index a) instance GHC.Show.Show a => GHC.Show.Show (Language.Fortran.AST.Index a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Language.Fortran.AST.Index a) instance GHC.Base.Functor Language.Fortran.AST.Value instance GHC.Generics.Generic (Language.Fortran.AST.Value a) instance Data.Data.Data a => Data.Data.Data (Language.Fortran.AST.Value a) instance GHC.Show.Show a => GHC.Show.Show (Language.Fortran.AST.Value a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Language.Fortran.AST.Value a) instance GHC.Base.Functor Language.Fortran.AST.Expression instance GHC.Generics.Generic (Language.Fortran.AST.Expression a) instance Data.Data.Data a => Data.Data.Data (Language.Fortran.AST.Expression a) instance GHC.Show.Show a => GHC.Show.Show (Language.Fortran.AST.Expression a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Language.Fortran.AST.Expression a) instance GHC.Base.Functor Language.Fortran.AST.ProgramFile instance GHC.Generics.Generic (Language.Fortran.AST.ProgramFile a) instance Data.Data.Data a => Data.Data.Data (Language.Fortran.AST.ProgramFile a) instance GHC.Show.Show a => GHC.Show.Show (Language.Fortran.AST.ProgramFile a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Language.Fortran.AST.ProgramFile a) instance GHC.Generics.Generic Language.Fortran.AST.ProgramUnitName instance Data.Data.Data Language.Fortran.AST.ProgramUnitName instance GHC.Show.Show Language.Fortran.AST.ProgramUnitName instance GHC.Classes.Eq Language.Fortran.AST.ProgramUnitName instance GHC.Classes.Ord Language.Fortran.AST.ProgramUnitName instance Language.Fortran.AST.Named (Language.Fortran.AST.ProgramUnit a) instance Data.Binary.Class.Binary Language.Fortran.AST.ProgramUnitName instance Control.DeepSeq.NFData Language.Fortran.AST.ProgramUnitName instance Language.Fortran.AST.Conditioned Language.Fortran.AST.Block instance Language.Fortran.AST.Conditioned Language.Fortran.AST.Statement instance Language.Fortran.AST.Labeled Language.Fortran.AST.Block instance Language.Fortran.Util.Position.Spanned a => Language.Fortran.Util.Position.Spanned [a] instance (Language.Fortran.Util.Position.Spanned a, Language.Fortran.Util.Position.Spanned b) => Language.Fortran.Util.Position.Spanned (a, GHC.Maybe.Maybe b) instance (Language.Fortran.Util.Position.Spanned a, Language.Fortran.Util.Position.Spanned b) => Language.Fortran.Util.Position.Spanned (GHC.Maybe.Maybe a, b) instance (Language.Fortran.Util.Position.Spanned a, Language.Fortran.Util.Position.Spanned b) => Language.Fortran.Util.Position.Spanned (a, b) instance (Language.Fortran.Util.Position.Spanned a, Language.Fortran.Util.Position.Spanned b, Language.Fortran.Util.Position.Spanned c) => Language.Fortran.Util.Position.Spanned (GHC.Maybe.Maybe a, GHC.Maybe.Maybe b, GHC.Maybe.Maybe c) instance (Language.Fortran.Util.Position.Spanned a, Language.Fortran.Util.Position.Spanned b, Language.Fortran.Util.Position.Spanned c) => Language.Fortran.Util.Position.Spanned (a, GHC.Maybe.Maybe b, GHC.Maybe.Maybe c) instance (Language.Fortran.Util.Position.Spanned a, Language.Fortran.Util.Position.Spanned b, Language.Fortran.Util.Position.Spanned c) => Language.Fortran.Util.Position.Spanned (GHC.Maybe.Maybe a, b, c) instance (Language.Fortran.Util.Position.Spanned a, Language.Fortran.Util.Position.Spanned b, Language.Fortran.Util.Position.Spanned c) => Language.Fortran.Util.Position.Spanned (a, b, c) instance (Language.Fortran.Util.Position.Spanned a, Language.Fortran.Util.Position.Spanned b) => Language.Fortran.AST.SpannedPair a b instance (Language.Fortran.Util.Position.Spanned a, Language.Fortran.Util.Position.Spanned b) => Language.Fortran.AST.SpannedPair a [b] instance (Language.Fortran.Util.Position.Spanned a, Language.Fortran.Util.Position.Spanned b) => Language.Fortran.AST.SpannedPair a [[b]] instance Language.Fortran.AST.Annotated (Language.Fortran.AST.AList t) instance Language.Fortran.AST.Annotated Language.Fortran.AST.ProgramUnit instance Language.Fortran.AST.Annotated Language.Fortran.AST.Block instance Language.Fortran.AST.Annotated Language.Fortran.AST.Statement instance Language.Fortran.AST.Annotated Language.Fortran.AST.Argument instance Language.Fortran.AST.Annotated Language.Fortran.AST.Use instance Language.Fortran.AST.Annotated Language.Fortran.AST.TypeSpec instance Language.Fortran.AST.Annotated Language.Fortran.AST.ProcDecl instance Language.Fortran.AST.Annotated Language.Fortran.AST.ProcInterface instance Language.Fortran.AST.Annotated Language.Fortran.AST.Selector instance Language.Fortran.AST.Annotated Language.Fortran.AST.Attribute instance Language.Fortran.AST.Annotated Language.Fortran.AST.ImpList instance Language.Fortran.AST.Annotated Language.Fortran.AST.ImpElement instance Language.Fortran.AST.Annotated Language.Fortran.AST.CommonGroup instance Language.Fortran.AST.Annotated Language.Fortran.AST.DataGroup instance Language.Fortran.AST.Annotated Language.Fortran.AST.StructureItem instance Language.Fortran.AST.Annotated Language.Fortran.AST.UnionMap instance Language.Fortran.AST.Annotated Language.Fortran.AST.Namelist instance Language.Fortran.AST.Annotated Language.Fortran.AST.FormatItem instance Language.Fortran.AST.Annotated Language.Fortran.AST.Expression instance Language.Fortran.AST.Annotated Language.Fortran.AST.Index instance Language.Fortran.AST.Annotated Language.Fortran.AST.DoSpecification instance Language.Fortran.AST.Annotated Language.Fortran.AST.FlushSpec instance Language.Fortran.AST.Annotated Language.Fortran.AST.Declarator instance Language.Fortran.AST.Annotated Language.Fortran.AST.DimensionDeclarator instance Language.Fortran.AST.Annotated Language.Fortran.AST.ControlPair instance Language.Fortran.AST.Annotated Language.Fortran.AST.AllocOpt instance Language.Fortran.Util.Position.Spanned (Language.Fortran.AST.ProgramFile a) instance Text.PrettyPrint.GenericPretty.Out a => Text.PrettyPrint.GenericPretty.Out (Language.Fortran.AST.ProgramFile a) instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Language.Fortran.AST.ProgramFile a) instance Language.Fortran.Util.FirstParameter.FirstParameter (Language.Fortran.AST.ProgramUnit a) a instance Language.Fortran.Util.FirstParameter.FirstParameter (Language.Fortran.AST.Suffix a) a instance Language.Fortran.Util.FirstParameter.FirstParameter (Language.Fortran.AST.Block a) a instance Language.Fortran.Util.FirstParameter.FirstParameter (Language.Fortran.AST.Statement a) a instance Language.Fortran.Util.FirstParameter.FirstParameter (Language.Fortran.AST.Argument a) a instance Language.Fortran.Util.FirstParameter.FirstParameter (Language.Fortran.AST.Use a) a instance Language.Fortran.Util.FirstParameter.FirstParameter (Language.Fortran.AST.TypeSpec a) a instance Language.Fortran.Util.FirstParameter.FirstParameter (Language.Fortran.AST.ProcDecl a) a instance Language.Fortran.Util.FirstParameter.FirstParameter (Language.Fortran.AST.ProcInterface a) a instance Language.Fortran.Util.FirstParameter.FirstParameter (Language.Fortran.AST.Selector a) a instance Language.Fortran.Util.FirstParameter.FirstParameter (Language.Fortran.AST.Attribute a) a instance Language.Fortran.Util.FirstParameter.FirstParameter (Language.Fortran.AST.ImpList a) a instance Language.Fortran.Util.FirstParameter.FirstParameter (Language.Fortran.AST.CommonGroup a) a instance Language.Fortran.Util.FirstParameter.FirstParameter (Language.Fortran.AST.DataGroup a) a instance Language.Fortran.Util.FirstParameter.FirstParameter (Language.Fortran.AST.StructureItem a) a instance Language.Fortran.Util.FirstParameter.FirstParameter (Language.Fortran.AST.UnionMap a) a instance Language.Fortran.Util.FirstParameter.FirstParameter (Language.Fortran.AST.Namelist a) a instance Language.Fortran.Util.FirstParameter.FirstParameter (Language.Fortran.AST.FormatItem a) a instance Language.Fortran.Util.FirstParameter.FirstParameter (Language.Fortran.AST.Expression a) a instance Language.Fortran.Util.FirstParameter.FirstParameter (Language.Fortran.AST.Index a) a instance Language.Fortran.Util.FirstParameter.FirstParameter (Language.Fortran.AST.DoSpecification a) a instance Language.Fortran.Util.FirstParameter.FirstParameter (Language.Fortran.AST.FlushSpec a) a instance Language.Fortran.Util.FirstParameter.FirstParameter (Language.Fortran.AST.Declarator a) a instance Language.Fortran.Util.FirstParameter.FirstParameter (Language.Fortran.AST.DimensionDeclarator a) a instance Language.Fortran.Util.FirstParameter.FirstParameter (Language.Fortran.AST.ControlPair a) a instance Language.Fortran.Util.FirstParameter.FirstParameter (Language.Fortran.AST.AllocOpt a) a instance Language.Fortran.Util.SecondParameter.SecondParameter (Language.Fortran.AST.ProgramUnit a) Language.Fortran.Util.Position.SrcSpan instance Language.Fortran.Util.SecondParameter.SecondParameter (Language.Fortran.AST.Suffix a) Language.Fortran.Util.Position.SrcSpan instance Language.Fortran.Util.SecondParameter.SecondParameter (Language.Fortran.AST.Block a) Language.Fortran.Util.Position.SrcSpan instance Language.Fortran.Util.SecondParameter.SecondParameter (Language.Fortran.AST.Statement a) Language.Fortran.Util.Position.SrcSpan instance Language.Fortran.Util.SecondParameter.SecondParameter (Language.Fortran.AST.Argument a) Language.Fortran.Util.Position.SrcSpan instance Language.Fortran.Util.SecondParameter.SecondParameter (Language.Fortran.AST.Use a) Language.Fortran.Util.Position.SrcSpan instance Language.Fortran.Util.SecondParameter.SecondParameter (Language.Fortran.AST.TypeSpec a) Language.Fortran.Util.Position.SrcSpan instance Language.Fortran.Util.SecondParameter.SecondParameter (Language.Fortran.AST.ProcDecl a) Language.Fortran.Util.Position.SrcSpan instance Language.Fortran.Util.SecondParameter.SecondParameter (Language.Fortran.AST.ProcInterface a) Language.Fortran.Util.Position.SrcSpan instance Language.Fortran.Util.SecondParameter.SecondParameter (Language.Fortran.AST.Selector a) Language.Fortran.Util.Position.SrcSpan instance Language.Fortran.Util.SecondParameter.SecondParameter (Language.Fortran.AST.Attribute a) Language.Fortran.Util.Position.SrcSpan instance Language.Fortran.Util.SecondParameter.SecondParameter (Language.Fortran.AST.ImpList a) Language.Fortran.Util.Position.SrcSpan instance Language.Fortran.Util.SecondParameter.SecondParameter (Language.Fortran.AST.CommonGroup a) Language.Fortran.Util.Position.SrcSpan instance Language.Fortran.Util.SecondParameter.SecondParameter (Language.Fortran.AST.DataGroup a) Language.Fortran.Util.Position.SrcSpan instance Language.Fortran.Util.SecondParameter.SecondParameter (Language.Fortran.AST.StructureItem a) Language.Fortran.Util.Position.SrcSpan instance Language.Fortran.Util.SecondParameter.SecondParameter (Language.Fortran.AST.UnionMap a) Language.Fortran.Util.Position.SrcSpan instance Language.Fortran.Util.SecondParameter.SecondParameter (Language.Fortran.AST.Namelist a) Language.Fortran.Util.Position.SrcSpan instance Language.Fortran.Util.SecondParameter.SecondParameter (Language.Fortran.AST.FormatItem a) Language.Fortran.Util.Position.SrcSpan instance Language.Fortran.Util.SecondParameter.SecondParameter (Language.Fortran.AST.Expression a) Language.Fortran.Util.Position.SrcSpan instance Language.Fortran.Util.SecondParameter.SecondParameter (Language.Fortran.AST.Index a) Language.Fortran.Util.Position.SrcSpan instance Language.Fortran.Util.SecondParameter.SecondParameter (Language.Fortran.AST.DoSpecification a) Language.Fortran.Util.Position.SrcSpan instance Language.Fortran.Util.SecondParameter.SecondParameter (Language.Fortran.AST.FlushSpec a) Language.Fortran.Util.Position.SrcSpan instance Language.Fortran.Util.SecondParameter.SecondParameter (Language.Fortran.AST.Declarator a) Language.Fortran.Util.Position.SrcSpan instance Language.Fortran.Util.SecondParameter.SecondParameter (Language.Fortran.AST.DimensionDeclarator a) Language.Fortran.Util.Position.SrcSpan instance Language.Fortran.Util.SecondParameter.SecondParameter (Language.Fortran.AST.ControlPair a) Language.Fortran.Util.Position.SrcSpan instance Language.Fortran.Util.SecondParameter.SecondParameter (Language.Fortran.AST.AllocOpt a) Language.Fortran.Util.Position.SrcSpan instance Language.Fortran.Util.Position.Spanned (Language.Fortran.AST.ProgramUnit a) instance Language.Fortran.Util.Position.Spanned (Language.Fortran.AST.Suffix a) instance Language.Fortran.Util.Position.Spanned (Language.Fortran.AST.Statement a) instance Language.Fortran.Util.Position.Spanned (Language.Fortran.AST.Argument a) instance Language.Fortran.Util.Position.Spanned (Language.Fortran.AST.Use a) instance Language.Fortran.Util.Position.Spanned (Language.Fortran.AST.Attribute a) instance Language.Fortran.Util.Position.Spanned (Language.Fortran.AST.TypeSpec a) instance Language.Fortran.Util.Position.Spanned (Language.Fortran.AST.ProcDecl a) instance Language.Fortran.Util.Position.Spanned (Language.Fortran.AST.ProcInterface a) instance Language.Fortran.Util.Position.Spanned (Language.Fortran.AST.Selector a) instance Language.Fortran.Util.Position.Spanned (Language.Fortran.AST.ImpList a) instance Language.Fortran.Util.Position.Spanned (Language.Fortran.AST.Block a) instance Language.Fortran.Util.Position.Spanned (Language.Fortran.AST.CommonGroup a) instance Language.Fortran.Util.Position.Spanned (Language.Fortran.AST.DataGroup a) instance Language.Fortran.Util.Position.Spanned (Language.Fortran.AST.StructureItem a) instance Language.Fortran.Util.Position.Spanned (Language.Fortran.AST.UnionMap a) instance Language.Fortran.Util.Position.Spanned (Language.Fortran.AST.Namelist a) instance Language.Fortran.Util.Position.Spanned (Language.Fortran.AST.FormatItem a) instance Language.Fortran.Util.Position.Spanned (Language.Fortran.AST.Expression a) instance Language.Fortran.Util.Position.Spanned (Language.Fortran.AST.Index a) instance Language.Fortran.Util.Position.Spanned (Language.Fortran.AST.DoSpecification a) instance Language.Fortran.Util.Position.Spanned (Language.Fortran.AST.FlushSpec a) instance Language.Fortran.Util.Position.Spanned (Language.Fortran.AST.Declarator a) instance Language.Fortran.Util.Position.Spanned (Language.Fortran.AST.DimensionDeclarator a) instance Language.Fortran.Util.Position.Spanned (Language.Fortran.AST.ControlPair a) instance Language.Fortran.Util.Position.Spanned (Language.Fortran.AST.AllocOpt a) instance Text.PrettyPrint.GenericPretty.Out a => Text.PrettyPrint.GenericPretty.Out (Language.Fortran.AST.ProgramUnit a) instance Text.PrettyPrint.GenericPretty.Out a => Text.PrettyPrint.GenericPretty.Out (Language.Fortran.AST.Suffix a) instance Text.PrettyPrint.GenericPretty.Out a => Text.PrettyPrint.GenericPretty.Out (Language.Fortran.AST.Statement a) instance Text.PrettyPrint.GenericPretty.Out a => Text.PrettyPrint.GenericPretty.Out (Language.Fortran.AST.ProcDecl a) instance Text.PrettyPrint.GenericPretty.Out a => Text.PrettyPrint.GenericPretty.Out (Language.Fortran.AST.ProcInterface a) instance Text.PrettyPrint.GenericPretty.Out a => Text.PrettyPrint.GenericPretty.Out (Language.Fortran.AST.Argument a) instance Text.PrettyPrint.GenericPretty.Out a => Text.PrettyPrint.GenericPretty.Out (Language.Fortran.AST.Use a) instance Text.PrettyPrint.GenericPretty.Out a => Text.PrettyPrint.GenericPretty.Out (Language.Fortran.AST.Attribute a) instance Text.PrettyPrint.GenericPretty.Out a => Text.PrettyPrint.GenericPretty.Out (Language.Fortran.AST.ImpList a) instance Text.PrettyPrint.GenericPretty.Out a => Text.PrettyPrint.GenericPretty.Out (Language.Fortran.AST.Block a) instance Text.PrettyPrint.GenericPretty.Out a => Text.PrettyPrint.GenericPretty.Out (Language.Fortran.AST.CommonGroup a) instance Text.PrettyPrint.GenericPretty.Out a => Text.PrettyPrint.GenericPretty.Out (Language.Fortran.AST.DataGroup a) instance Text.PrettyPrint.GenericPretty.Out a => Text.PrettyPrint.GenericPretty.Out (Language.Fortran.AST.StructureItem a) instance Text.PrettyPrint.GenericPretty.Out a => Text.PrettyPrint.GenericPretty.Out (Language.Fortran.AST.UnionMap a) instance Text.PrettyPrint.GenericPretty.Out a => Text.PrettyPrint.GenericPretty.Out (Language.Fortran.AST.Namelist a) instance Text.PrettyPrint.GenericPretty.Out a => Text.PrettyPrint.GenericPretty.Out (Language.Fortran.AST.FormatItem a) instance Text.PrettyPrint.GenericPretty.Out a => Text.PrettyPrint.GenericPretty.Out (Language.Fortran.AST.Expression a) instance Text.PrettyPrint.GenericPretty.Out a => Text.PrettyPrint.GenericPretty.Out (Language.Fortran.AST.Index a) instance Text.PrettyPrint.GenericPretty.Out a => Text.PrettyPrint.GenericPretty.Out (Language.Fortran.AST.DoSpecification a) instance Text.PrettyPrint.GenericPretty.Out a => Text.PrettyPrint.GenericPretty.Out (Language.Fortran.AST.FlushSpec a) instance Text.PrettyPrint.GenericPretty.Out a => Text.PrettyPrint.GenericPretty.Out (Language.Fortran.AST.Value a) instance Text.PrettyPrint.GenericPretty.Out a => Text.PrettyPrint.GenericPretty.Out (Language.Fortran.AST.TypeSpec a) instance Text.PrettyPrint.GenericPretty.Out a => Text.PrettyPrint.GenericPretty.Out (Language.Fortran.AST.Selector a) instance Text.PrettyPrint.GenericPretty.Out a => Text.PrettyPrint.GenericPretty.Out (Language.Fortran.AST.Declarator a) instance Text.PrettyPrint.GenericPretty.Out a => Text.PrettyPrint.GenericPretty.Out (Language.Fortran.AST.DimensionDeclarator a) instance Text.PrettyPrint.GenericPretty.Out a => Text.PrettyPrint.GenericPretty.Out (Language.Fortran.AST.ControlPair a) instance Text.PrettyPrint.GenericPretty.Out a => Text.PrettyPrint.GenericPretty.Out (Language.Fortran.AST.AllocOpt a) instance Text.PrettyPrint.GenericPretty.Out a => Text.PrettyPrint.GenericPretty.Out (Language.Fortran.AST.ForallHeader a) instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Language.Fortran.AST.ProgramUnit a) instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Language.Fortran.AST.Block a) instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Language.Fortran.AST.Expression a) instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Language.Fortran.AST.TypeSpec a) instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Language.Fortran.AST.Index a) instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Language.Fortran.AST.Value a) instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Language.Fortran.AST.Statement a) instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Language.Fortran.AST.ProcDecl a) instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Language.Fortran.AST.ProcInterface a) instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Language.Fortran.AST.DoSpecification a) instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Language.Fortran.AST.Selector a) instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Language.Fortran.AST.ForallHeader a) instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Language.Fortran.AST.Argument a) instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Language.Fortran.AST.Use a) instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Language.Fortran.AST.Attribute a) instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Language.Fortran.AST.CommonGroup a) instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Language.Fortran.AST.ControlPair a) instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Language.Fortran.AST.AllocOpt a) instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Language.Fortran.AST.DataGroup a) instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Language.Fortran.AST.DimensionDeclarator a) instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Language.Fortran.AST.Declarator a) instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Language.Fortran.AST.FormatItem a) instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Language.Fortran.AST.FlushSpec a) instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Language.Fortran.AST.ImpList a) instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Language.Fortran.AST.Namelist a) instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Language.Fortran.AST.Suffix a) instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Language.Fortran.AST.StructureItem a) instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Language.Fortran.AST.UnionMap a) instance Data.Binary.Class.Binary Language.Fortran.AST.BinaryOp instance Text.PrettyPrint.GenericPretty.Out Language.Fortran.AST.BinaryOp instance Control.DeepSeq.NFData Language.Fortran.AST.BinaryOp instance Data.Binary.Class.Binary Language.Fortran.AST.UnaryOp instance Text.PrettyPrint.GenericPretty.Out Language.Fortran.AST.UnaryOp instance Control.DeepSeq.NFData Language.Fortran.AST.UnaryOp instance Language.Fortran.Util.FirstParameter.FirstParameter (Language.Fortran.AST.ImpElement a) a instance Language.Fortran.Util.SecondParameter.SecondParameter (Language.Fortran.AST.ImpElement a) Language.Fortran.Util.Position.SrcSpan instance Language.Fortran.Util.Position.Spanned (Language.Fortran.AST.ImpElement a) instance Text.PrettyPrint.GenericPretty.Out a => Text.PrettyPrint.GenericPretty.Out (Language.Fortran.AST.ImpElement a) instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Language.Fortran.AST.ImpElement a) instance Text.PrettyPrint.GenericPretty.Out Language.Fortran.AST.Intent instance Control.DeepSeq.NFData Language.Fortran.AST.Intent instance Text.PrettyPrint.GenericPretty.Out Language.Fortran.AST.ModuleNature instance Control.DeepSeq.NFData Language.Fortran.AST.ModuleNature instance Text.PrettyPrint.GenericPretty.Out Language.Fortran.AST.Only instance Control.DeepSeq.NFData Language.Fortran.AST.Only instance Text.PrettyPrint.GenericPretty.Out a => Text.PrettyPrint.GenericPretty.Out (Language.Fortran.AST.Comment a) instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Language.Fortran.AST.Comment a) instance Language.Fortran.Util.FirstParameter.FirstParameter (Language.Fortran.AST.Prefix a) a instance Language.Fortran.Util.SecondParameter.SecondParameter (Language.Fortran.AST.Prefix a) Language.Fortran.Util.Position.SrcSpan instance Language.Fortran.Util.Position.Spanned (Language.Fortran.AST.Prefix a) instance Text.PrettyPrint.GenericPretty.Out a => Text.PrettyPrint.GenericPretty.Out (Language.Fortran.AST.Prefix a) instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Language.Fortran.AST.Prefix a) instance Text.PrettyPrint.GenericPretty.Out Language.Fortran.AST.MetaInfo instance Control.DeepSeq.NFData Language.Fortran.AST.MetaInfo instance Data.Binary.Class.Binary Language.Fortran.AST.BaseType instance Text.PrettyPrint.GenericPretty.Out Language.Fortran.AST.BaseType instance Control.DeepSeq.NFData Language.Fortran.AST.BaseType instance Data.Binary.Class.Binary Language.Fortran.AST.CharacterLen instance Text.PrettyPrint.GenericPretty.Out Language.Fortran.AST.CharacterLen instance Control.DeepSeq.NFData Language.Fortran.AST.CharacterLen instance GHC.Base.Functor t => GHC.Base.Functor (Language.Fortran.AST.AList t) instance Language.Fortran.Util.FirstParameter.FirstParameter (Language.Fortran.AST.AList t a) a instance Language.Fortran.Util.SecondParameter.SecondParameter (Language.Fortran.AST.AList t a) Language.Fortran.Util.Position.SrcSpan instance Language.Fortran.Util.Position.Spanned (Language.Fortran.AST.AList t a) instance (Text.PrettyPrint.GenericPretty.Out a, Text.PrettyPrint.GenericPretty.Out (t a)) => Text.PrettyPrint.GenericPretty.Out (Language.Fortran.AST.AList t a) instance (Control.DeepSeq.NFData a, Control.DeepSeq.NFData (t a)) => Control.DeepSeq.NFData (Language.Fortran.AST.AList t a) instance (Language.Fortran.Util.Position.Spanned a, Language.Fortran.Util.Position.Spanned b) => Language.Fortran.Util.Position.Spanned (Data.Either.Either a b) instance Text.PrettyPrint.GenericPretty.Out Language.Fortran.Version.FortranVersion instance Control.DeepSeq.NFData Language.Fortran.Version.FortranVersion module Language.Fortran.PrettyPrint tooOld :: FortranVersion -> String -> FortranVersion -> a (>) :: Doc -> Doc -> Doc infixl 7 > (+>) :: Doc -> Doc -> Doc infixl 7 +> newline :: Doc type Indentation = Maybe Int incIndentation :: Indentation -> Indentation indent :: Indentation -> Doc -> Doc overlay :: Doc -> Doc -> Doc fixedForm :: Indentation pprintAndRender :: IndentablePretty t => FortranVersion -> t -> Indentation -> String class IndentablePretty t pprint :: IndentablePretty t => FortranVersion -> t -> Indentation -> Doc endGen :: Pretty a => FortranVersion -> Doc -> a -> Indentation -> Doc class Pretty t pprint' :: Pretty t => FortranVersion -> t -> Doc commaSep :: [Doc] -> Doc data ReformatState -- | Unsure yet whether current line it's a comment or statement. RefmtStNewline :: Int -> ReformatState -- | Current line is a comment; no need to track column number. RefmtStComment :: ReformatState -- | Current line is a statement. RefmtStStmt :: Int -> ReformatState -- | Add continuations where required to a pretty-printed program. -- -- Ensures that no non-comment line exceeds 72 columns. -- -- The reformatting should be compatible with fixed and free-form Fortran -- standards. See: -- http://fortranwiki.org/fortran/show/Continuation+lines -- -- This is a simple, delicate algorithm that must only be used on pretty -- printer output, due to relying on particular parser & pretty -- printer behaviour. In particular, comments not beginning a line (e.g. -- after a statement or continuation) won't be picked up as a comment, so -- could wreck that line. Be warned if you're using it on piles of -- funky-looking code! reformatMixedFormInsertContinuations :: String -> String instance GHC.Show.Show Language.Fortran.PrettyPrint.ReformatState instance GHC.Classes.Ord Language.Fortran.PrettyPrint.ReformatState instance GHC.Classes.Eq Language.Fortran.PrettyPrint.ReformatState instance Language.Fortran.PrettyPrint.Pretty a => Language.Fortran.PrettyPrint.IndentablePretty a instance Language.Fortran.PrettyPrint.IndentablePretty (Language.Fortran.AST.ProgramUnit a) instance Language.Fortran.PrettyPrint.IndentablePretty (Language.Fortran.AST.Block a) instance Language.Fortran.PrettyPrint.Pretty a => Language.Fortran.PrettyPrint.Pretty (GHC.Maybe.Maybe a) instance Language.Fortran.PrettyPrint.Pretty GHC.Base.String instance Language.Fortran.PrettyPrint.Pretty (e a) => Language.Fortran.PrettyPrint.Pretty (Language.Fortran.AST.AList e a) instance Language.Fortran.PrettyPrint.Pretty Language.Fortran.AST.BaseType instance Language.Fortran.PrettyPrint.Pretty Language.Fortran.AST.CharacterLen instance Language.Fortran.PrettyPrint.Pretty (Language.Fortran.AST.TypeSpec a) instance Language.Fortran.PrettyPrint.Pretty (Language.Fortran.AST.Selector a) instance Language.Fortran.PrettyPrint.Pretty (Language.Fortran.AST.Statement a) instance Language.Fortran.PrettyPrint.Pretty (Language.Fortran.AST.ProcInterface a) instance Language.Fortran.PrettyPrint.Pretty (Language.Fortran.AST.ProcDecl a) instance Language.Fortran.PrettyPrint.Pretty Language.Fortran.AST.Only instance Language.Fortran.PrettyPrint.Pretty (Language.Fortran.AST.Use a) instance Language.Fortran.PrettyPrint.Pretty (Language.Fortran.AST.Argument a) instance Language.Fortran.PrettyPrint.Pretty (Language.Fortran.AST.Attribute a) instance Language.Fortran.PrettyPrint.Pretty (Language.Fortran.AST.Suffix a) instance Language.Fortran.PrettyPrint.Pretty Language.Fortran.AST.Intent instance Language.Fortran.PrettyPrint.Pretty (Language.Fortran.AST.FormatItem a) instance Language.Fortran.PrettyPrint.Pretty (Language.Fortran.AST.FlushSpec a) instance Language.Fortran.PrettyPrint.Pretty (Language.Fortran.AST.DoSpecification a) instance Language.Fortran.PrettyPrint.Pretty (Language.Fortran.AST.ControlPair a) instance Language.Fortran.PrettyPrint.Pretty (Language.Fortran.AST.AllocOpt a) instance Language.Fortran.PrettyPrint.Pretty (Language.Fortran.AST.ImpList a) instance Language.Fortran.PrettyPrint.Pretty (Language.Fortran.AST.CommonGroup a) instance Language.Fortran.PrettyPrint.Pretty (Language.Fortran.AST.Namelist a) instance Language.Fortran.PrettyPrint.Pretty (Language.Fortran.AST.DataGroup a) instance Language.Fortran.PrettyPrint.Pretty (Language.Fortran.AST.ImpElement a) instance Language.Fortran.PrettyPrint.Pretty (Language.Fortran.AST.Expression a) instance Language.Fortran.PrettyPrint.Pretty (Language.Fortran.AST.Index a) instance Language.Fortran.PrettyPrint.Pretty (Language.Fortran.AST.Value a) instance Language.Fortran.PrettyPrint.IndentablePretty (Language.Fortran.AST.StructureItem a) instance Language.Fortran.PrettyPrint.Pretty (Language.Fortran.AST.Declarator a) instance Language.Fortran.PrettyPrint.Pretty (Language.Fortran.AST.DimensionDeclarator a) instance Language.Fortran.PrettyPrint.Pretty Language.Fortran.AST.UnaryOp instance Language.Fortran.PrettyPrint.Pretty Language.Fortran.AST.BinaryOp instance Language.Fortran.PrettyPrint.IndentablePretty a => Language.Fortran.PrettyPrint.IndentablePretty (GHC.Maybe.Maybe a) instance Language.Fortran.PrettyPrint.IndentablePretty (Language.Fortran.AST.ProgramFile a) instance Language.Fortran.PrettyPrint.IndentablePretty [Language.Fortran.AST.ProgramUnit a] instance Language.Fortran.PrettyPrint.IndentablePretty [Language.Fortran.AST.Block a] instance Language.Fortran.PrettyPrint.IndentablePretty (Language.Fortran.AST.UnionMap a) instance Language.Fortran.Util.FirstParameter.FirstParameter (Language.Fortran.AST.Value a) GHC.Base.String module Language.Fortran.LValue -- | A subset of Expression which can only contain values that can -- be assigned to. data LValue a LvSimpleVar :: a -> SrcSpan -> Name -> LValue a LvSubscript :: a -> SrcSpan -> LValue a -> AList Index a -> LValue a LvDataRef :: a -> SrcSpan -> LValue a -> LValue a -> LValue a -- | If the expression can be seen as an lvalue, convert it to an -- LValue. toLValue :: Expression a -> Maybe (LValue a) instance GHC.Base.Functor Language.Fortran.LValue.LValue instance GHC.Generics.Generic (Language.Fortran.LValue.LValue a) instance Data.Data.Data a => Data.Data.Data (Language.Fortran.LValue.LValue a) instance GHC.Show.Show a => GHC.Show.Show (Language.Fortran.LValue.LValue a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Language.Fortran.LValue.LValue a) instance Language.Fortran.Util.FirstParameter.FirstParameter (Language.Fortran.LValue.LValue a) a instance Language.Fortran.Util.SecondParameter.SecondParameter (Language.Fortran.LValue.LValue a) Language.Fortran.Util.Position.SrcSpan instance Language.Fortran.AST.Annotated Language.Fortran.LValue.LValue instance Language.Fortran.Util.Position.Spanned (Language.Fortran.LValue.LValue a) -- | Common data structures and functions supporting analysis of the AST. module Language.Fortran.Analysis -- | Create analysis annotations for the program, saving the original -- annotations. initAnalysis :: Functor b => b a -> b (Analysis a) -- | Remove analysis annotations from the program, restoring the original -- annotations. stripAnalysis :: Functor b => b (Analysis a) -> b a data Analysis a Analysis :: a -> Maybe String -> Maybe String -> Maybe (BBGr (Analysis a)) -> Maybe Int -> Maybe ModEnv -> Maybe IDType -> [Name] -> Maybe Constant -> Analysis a -- | original annotation [prevAnnotation] :: Analysis a -> a -- | unique name for function/variable, after variable renaming phase [uniqueName] :: Analysis a -> Maybe String -- | original name for function/variable found in source text [sourceName] :: Analysis a -> Maybe String -- | basic block graph [bBlocks] :: Analysis a -> Maybe (BBGr (Analysis a)) -- | unique number for each block during dataflow analysis [insLabel] :: Analysis a -> Maybe Int [moduleEnv] :: Analysis a -> Maybe ModEnv [idType] :: Analysis a -> Maybe IDType [allLhsVarsAnn] :: Analysis a -> [Name] [constExp] :: Analysis a -> Maybe Constant -- | Information about potential / actual constant expressions. data Constant -- | interpreted integer ConstInt :: Integer -> Constant -- | uninterpreted integer ConstUninterpInt :: String -> Constant -- | uninterpreted real ConstUninterpReal :: String -> Constant -- | binary operation on potential constants ConstBinary :: BinaryOp -> Constant -> Constant -> Constant -- | unary operation on potential constants ConstUnary :: UnaryOp -> Constant -> Constant -- | Obtain either uniqueName or source name from an ExpValue variable. varName :: Expression (Analysis a) -> String -- | Obtain the source name from an ExpValue variable. srcName :: Expression (Analysis a) -> String -- | Obtain either uniqueName or source name from an LvSimpleVar variable. lvVarName :: LValue (Analysis a) -> String -- | Obtain the source name from an LvSimpleVar variable. lvSrcName :: LValue (Analysis a) -> String -- | True iff the expression can be used with varName or srcName isNamedExpression :: Expression a -> Bool -- | Generate an ExpValue variable with its source name == to its -- uniqueName. genVar :: Analysis a -> SrcSpan -> String -> Expression (Analysis a) -- | Obtain either ProgramUnit uniqueName or whatever is in the AST. puName :: ProgramUnit (Analysis a) -> ProgramUnitName -- | Obtain either ProgramUnit sourceName or whatever is in the AST. puSrcName :: ProgramUnit (Analysis a) -> ProgramUnitName -- | Set of expressions used -- not defined -- by an AST-block. blockRhsExprs :: Data a => Block a -> [Expression a] -- | Return list of expressions that are not "left-hand-side" of assignment -- statements. rhsExprs :: (Data a, Data (b a)) => b a -> [Expression a] type ModEnv = Map String (String, NameType) data NameType NTSubprogram :: NameType NTVariable :: NameType NTIntrinsic :: NameType data IDType IDType :: Maybe BaseType -> Maybe ConstructType -> IDType [idVType] :: IDType -> Maybe BaseType [idCType] :: IDType -> Maybe ConstructType data ConstructType CTFunction :: ConstructType CTSubroutine :: ConstructType CTExternal :: ConstructType CTVariable :: ConstructType CTArray :: [(Maybe Int, Maybe Int)] -> ConstructType CTParameter :: ConstructType CTIntrinsic :: ConstructType data BaseType TypeInteger :: BaseType TypeReal :: BaseType TypeDoublePrecision :: BaseType TypeComplex :: BaseType TypeDoubleComplex :: BaseType TypeLogical :: BaseType -- | len and kind, if specified TypeCharacter :: Maybe CharacterLen -> Maybe String -> BaseType TypeCustom :: String -> BaseType ClassStar :: BaseType ClassCustom :: String -> BaseType TypeByte :: BaseType -- | Return list of expressions used as the left-hand-side of assignment -- statements (including for-loops and function-calls by reference). lhsExprs :: forall a b. (Data a, Data (b a)) => b a -> [Expression a] -- | Is this an expression capable of assignment? isLExpr :: Expression a -> Bool -- | Set of names found in an AST node. allVars :: forall a b. (Data a, Data (b (Analysis a))) => b (Analysis a) -> [Name] -- | Initiate (lazy) computation of all LHS variables for each node of the -- AST so that it may be accessed later. analyseAllLhsVars :: forall a. Data a => ProgramFile (Analysis a) -> ProgramFile (Analysis a) analyseAllLhsVars1 :: (Annotated f, Data (f (Analysis a)), Data a) => f (Analysis a) -> f (Analysis a) -- | Set of names found in the parts of an AST that are the target of an -- assignment statement. allLhsVars :: (Annotated b, Data a, Data (b -- (Analysis a))) => b (Analysis a) -> [Name] allLhsVars :: Data a => Block (Analysis a) -> [Name] -- | Set of names used -- not defined -- by an AST-block. blockVarUses :: forall a. Data a => Block (Analysis a) -> [Name] -- | Set of names defined by an AST-block. blockVarDefs :: Data a => Block (Analysis a) -> [Name] -- | Basic block type BB a = [Block a] type BBNode = Int -- | Basic block graph. data BBGr a BBGr :: Gr (BB a) () -> [Node] -> [Node] -> BBGr a -- | the underlying graph [bbgrGr] :: BBGr a -> Gr (BB a) () -- | the entry node(s) [bbgrEntries] :: BBGr a -> [Node] -- | the exit node(s) [bbgrExits] :: BBGr a -> [Node] -- | Call function on the underlying graph bbgrMap :: (Gr (BB a) () -> Gr (BB b) ()) -> BBGr a -> BBGr b -- | Monadically call function on the underlying graph bbgrMapM :: Monad m => (Gr (BB a1) () -> m (Gr (BB a2) ())) -> BBGr a1 -> m (BBGr a2) -- | Empty basic block graph bbgrEmpty :: BBGr a -- | The type of "transformBi"-family functions type TransFunc f g a = (f (Analysis a) -> f (Analysis a)) -> g (Analysis a) -> g (Analysis a) -- | The type of "transformBiM"-family functions type TransFuncM m f g a = (f (Analysis a) -> m (f (Analysis a))) -> g (Analysis a) -> m (g (Analysis a)) instance GHC.Generics.Generic (Language.Fortran.Analysis.BBGr a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Language.Fortran.Analysis.BBGr a) instance GHC.Show.Show a => GHC.Show.Show (Language.Fortran.Analysis.BBGr a) instance Data.Data.Data a => Data.Data.Data (Language.Fortran.Analysis.BBGr a) instance GHC.Generics.Generic Language.Fortran.Analysis.NameType instance Data.Data.Data Language.Fortran.Analysis.NameType instance GHC.Classes.Ord Language.Fortran.Analysis.NameType instance GHC.Classes.Eq Language.Fortran.Analysis.NameType instance GHC.Show.Show Language.Fortran.Analysis.NameType instance GHC.Generics.Generic Language.Fortran.Analysis.ConstructType instance Data.Data.Data Language.Fortran.Analysis.ConstructType instance GHC.Show.Show Language.Fortran.Analysis.ConstructType instance GHC.Classes.Eq Language.Fortran.Analysis.ConstructType instance GHC.Classes.Ord Language.Fortran.Analysis.ConstructType instance GHC.Generics.Generic Language.Fortran.Analysis.IDType instance Data.Data.Data Language.Fortran.Analysis.IDType instance GHC.Show.Show Language.Fortran.Analysis.IDType instance GHC.Classes.Eq Language.Fortran.Analysis.IDType instance GHC.Classes.Ord Language.Fortran.Analysis.IDType instance Data.Data.Data Language.Fortran.Analysis.Constant instance GHC.Generics.Generic Language.Fortran.Analysis.Constant instance GHC.Classes.Eq Language.Fortran.Analysis.Constant instance GHC.Classes.Ord Language.Fortran.Analysis.Constant instance GHC.Show.Show Language.Fortran.Analysis.Constant instance GHC.Generics.Generic (Language.Fortran.Analysis.Analysis a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Language.Fortran.Analysis.Analysis a) instance GHC.Show.Show a => GHC.Show.Show (Language.Fortran.Analysis.Analysis a) instance Data.Data.Data a => Data.Data.Data (Language.Fortran.Analysis.Analysis a) instance GHC.Base.Functor Language.Fortran.Analysis.Analysis instance Text.PrettyPrint.GenericPretty.Out (Language.Fortran.Analysis.Analysis a) instance Text.PrettyPrint.GenericPretty.Out Language.Fortran.Analysis.Constant instance Data.Binary.Class.Binary Language.Fortran.Analysis.Constant instance Text.PrettyPrint.GenericPretty.Out Language.Fortran.Analysis.IDType instance Data.Binary.Class.Binary Language.Fortran.Analysis.IDType instance Text.PrettyPrint.GenericPretty.Out Language.Fortran.Analysis.ConstructType instance Data.Binary.Class.Binary Language.Fortran.Analysis.ConstructType instance Data.Binary.Class.Binary Language.Fortran.Analysis.NameType instance Text.PrettyPrint.GenericPretty.Out Language.Fortran.Analysis.NameType instance (Data.Typeable.Internal.Typeable a, Data.Typeable.Internal.Typeable b) => Data.Data.Data (Data.Graph.Inductive.PatriciaTree.Gr a b) module Language.Fortran.Analysis.Types -- | Annotate AST nodes with type information and also return a type -- environment mapping names to type information. analyseTypes :: Data a => ProgramFile (Analysis a) -> (ProgramFile (Analysis a), TypeEnv) -- | Annotate AST nodes with type information and also return a type -- environment mapping names to type information; provided with a -- starting type environment. analyseTypesWithEnv :: Data a => TypeEnv -> ProgramFile (Analysis a) -> (ProgramFile (Analysis a), TypeEnv) -- | Annotate AST nodes with type information, return a type environment -- mapping names to type information and return any type errors found; -- provided with a starting type environment. analyseAndCheckTypesWithEnv :: Data a => TypeEnv -> ProgramFile (Analysis a) -> (ProgramFile (Analysis a), TypeEnv, [TypeError]) extractTypeEnv :: forall a. Data a => ProgramFile (Analysis a) -> TypeEnv -- | Mapping of names to type information. type TypeEnv = Map Name IDType -- | Information about a detected type error. type TypeError = (String, SrcSpan) instance GHC.Show.Show Language.Fortran.Analysis.Types.InferState -- | Analyse variables/function names and produce unique names that can be -- used to replace the original names while maintaining program -- equivalence (a.k.a. alpha-conversion). The advantage of the unique -- names is that scoping issues can be ignored when doing further -- analysis. module Language.Fortran.Analysis.Renaming -- | Annotate unique names for variable and function declarations and uses. analyseRenames :: Data a => ProgramFile (Analysis a) -> ProgramFile (Analysis a) -- | Annotate unique names for variable and function declarations and uses. -- With external module map. analyseRenamesWithModuleMap :: Data a => ModuleMap -> ProgramFile (Analysis a) -> ProgramFile (Analysis a) -- | Take the unique name annotations and substitute them into the actual -- AST. rename :: Data a => ProgramFile (Analysis a) -> ProgramFile (Analysis a) -- | Take a renamed program and undo the renames. unrename :: Data a => ProgramFile (Analysis a) -> ProgramFile (Analysis a) type ModuleMap = Map ProgramUnitName ModEnv instance GHC.Classes.Eq Language.Fortran.Analysis.Renaming.RenameState instance GHC.Show.Show Language.Fortran.Analysis.Renaming.RenameState module Language.Fortran.Transformation.TransformMonad getProgramFile :: Transform a (ProgramFile (Analysis a)) putProgramFile :: ProgramFile (Analysis a) -> Transform a () modifyProgramFile :: (ProgramFile (Analysis a) -> ProgramFile (Analysis a)) -> Transform a () runTransform :: Data a => TypeEnv -> ModuleMap -> Transform a () -> ProgramFile a -> ProgramFile a type Transform a = State (TransformationState a) module Language.Fortran.Transformation.Grouping groupForall :: Data a => Transform a () groupIf :: Data a => Transform a () groupDo :: Data a => Transform a () groupLabeledDo :: Data a => Transform a () groupCase :: Data a => Transform a () module Language.Fortran.Transformation.Disambiguation.Intrinsic disambiguateIntrinsic :: Data a => Transform a () module Language.Fortran.Transformation.Disambiguation.Function disambiguateFunction :: Data a => Transform a () instance Language.Fortran.Transformation.Disambiguation.Function.Indexed Language.Fortran.AST.Argument instance Language.Fortran.Transformation.Disambiguation.Function.Indexed Language.Fortran.AST.Expression -- | Analyse a program file and create basic blocks. module Language.Fortran.Analysis.BBlocks -- | Insert basic block graphs into each program unit's analysis analyseBBlocks :: Data a => ProgramFile (Analysis a) -> ProgramFile (Analysis a) -- | Create a mapping of (non-module) program unit names to their -- associated bblock graph. genBBlockMap :: Data a => ProgramFile (Analysis a) -> BBlockMap (Analysis a) -- | Show a basic block graph in a somewhat decent way. showBBGr :: (Out a, Show a) => BBGr a -> String -- | Show a basic block graph without the clutter showAnalysedBBGr :: (Out a, Show a) => BBGr (Analysis a) -> String -- | Pick out and show the basic block graphs in the program file analysis. showBBlocks :: (Data a, Out a, Show a) => ProgramFile (Analysis a) -> String -- | Output a graph in the GraphViz DOT format bbgrToDOT :: BBGr a -> String -- | A mapping of program unit names to bblock graphs. type BBlockMap a = Map ProgramUnitName (BBGr a) type ASTBlockNode = Int type ASTExprNode = Int genSuperBBGr :: forall a. Data a => BBlockMap (Analysis a) -> SuperBBGr (Analysis a) data SuperBBGr a SuperBBGr :: BBGr a -> IntMap ProgramUnitName -> Map PUName SuperNode -> SuperBBGr a [superBBGrGraph] :: SuperBBGr a -> BBGr a [superBBGrClusters] :: SuperBBGr a -> IntMap ProgramUnitName [superBBGrEntries] :: SuperBBGr a -> Map PUName SuperNode -- | Show a basic block supergraph showSuperBBGr :: (Out a, Show a) => SuperBBGr (Analysis a) -> String -- | Output a supergraph in the GraphViz DOT format superBBGrToDOT :: SuperBBGr a -> String findLabeledBBlock :: String -> BBGr a -> Maybe Node -- | Some helper functions to output some pseudo-code for readability. showBlock :: Block a -> String -- | Dataflow analysis to be applied once basic block analysis is complete. module Language.Fortran.Analysis.DataFlow -- | Compute dominators of each bblock in the graph. Node A dominates node -- B when all paths from the start node of that program unit must pass -- through node A in order to reach node B. That will be represented as -- the relation (B, [A, ...]) in the DomMap. dominators :: BBGr a -> DomMap -- | Compute the immediate dominator of each bblock in the graph. The -- immediate dominator is, in a sense, the closest dominator of -- a node. Given nodes A and B, you can say that node A is immediately -- dominated by node B if there does not exist any node C such that: node -- A dominates node C and node C dominates node B. iDominators :: BBGr a -> IDomMap -- | DomMap : node -> dominators of node type DomMap = BBNodeMap BBNodeSet -- | IDomMap : node -> immediate dominator of node type IDomMap = BBNodeMap BBNode -- | The postordering of a graph outputs the label after traversal of -- children. postOrder :: OrderF a -- | Reversed postordering. revPostOrder :: OrderF a -- | The preordering of a graph outputs the label before traversal of -- children. preOrder :: OrderF a -- | Reversed preordering. revPreOrder :: OrderF a -- | An OrderF is a function from graph to a specific ordering of nodes. type OrderF a = BBGr a -> [Node] -- | Apply the iterative dataflow analysis method. Forces evaluation of -- intermediate data structures at each step. dataFlowSolver :: (NFData t, Ord t) => BBGr a -> (Node -> InOut t) -> OrderF a -> (OutF t -> InF t) -> (InF t -> OutF t) -> InOutMap t -- | InOut : (dataflow into the bblock, dataflow out of the bblock) type InOut t = (t, t) -- | InOutMap : node -> (dataflow into node, dataflow out of node) type InOutMap t = BBNodeMap (InOut t) -- | InF, a function that returns the in-dataflow for a given node type InF t = Node -> t -- | OutF, a function that returns the out-dataflow for a given node type OutF t = Node -> t -- | Dataflow analysis for live variables given basic block graph. -- Muchnick, p. 445: A variable is "live" at a particular program point -- if there is a path to the exit along which its value may be used -- before it is redefined. It is "dead" if there is no such path. liveVariableAnalysis :: Data a => BBGr (Analysis a) -> InOutMap (Set Name) -- | Reaching definitions dataflow analysis. Reaching definitions are the -- set of variable-defining AST-block labels that may reach a program -- point. Suppose AST-block with label A defines a variable named v. -- Label A may reach another program point labeled P if there is at least -- one program path from label A to label P that does not redefine -- variable v. reachingDefinitions :: Data a => DefMap -> BBGr (Analysis a) -> InOutMap ASTBlockNodeSet -- | use-def map: map AST-block labels of variable-using AST-blocks to the -- AST-blocks that define those variables. genUDMap :: Data a => BlockMap a -> DefMap -> BBGr (Analysis a) -> InOutMap ASTBlockNodeSet -> UDMap -- | def-use map: map AST-block labels of defining AST-blocks to the -- AST-blocks that may use the definition. genDUMap :: Data a => BlockMap a -> DefMap -> BBGr (Analysis a) -> InOutMap ASTBlockNodeSet -> DUMap -- | Invert the DUMap into a UDMap duMapToUdMap :: DUMap -> UDMap -- | UDMap : use -> { definition } type UDMap = ASTBlockNodeMap ASTBlockNodeSet -- | DUMap : definition -> { use } type DUMap = ASTBlockNodeMap ASTBlockNodeSet -- | "Flows-To" analysis. Represent def-use map as a graph. genFlowsToGraph :: Data a => BlockMap a -> DefMap -> BBGr (Analysis a) -> InOutMap ASTBlockNodeSet -> FlowsGraph a -- | FlowsGraph : nodes as AST-block (numbered by label), edges showing -- which definitions contribute to which uses. type FlowsGraph a = Gr (Block (Analysis a)) () -- | Create a map (A -> Bs) where A "flows" or contributes towards the -- variables Bs. genVarFlowsToMap :: Data a => DefMap -> FlowsGraph a -> VarFlowsMap -- | Represent "flows" between variables type VarFlowsMap = Map Name (Set Name) -- | Information about potential / actual constant expressions. data Constant -- | interpreted integer ConstInt :: Integer -> Constant -- | uninterpreted integer ConstUninterpInt :: String -> Constant -- | uninterpreted real ConstUninterpReal :: String -> Constant -- | binary operation on potential constants ConstBinary :: BinaryOp -> Constant -> Constant -> Constant -- | unary operation on potential constants ConstUnary :: UnaryOp -> Constant -> Constant -- | The map of all parameter variables and their corresponding values type ParameterVarMap = Map Name Constant -- | The map of all expressions and whether they are undecided (not present -- in map), a constant value (Just Constant), or probably not constant -- (Nothing). type ConstExpMap = ASTExprNodeMap (Maybe Constant) -- | Generate a constant-expression map with information about the -- expressions (identified by insLabel numbering) in the ProgramFile pf -- (must have analysis initiated & basic blocks generated) . genConstExpMap :: forall a. Data a => ProgramFile (Analysis a) -> ConstExpMap -- | Get constant-expression information and put it into the AST analysis -- annotation. Must occur after analyseBBlocks. analyseConstExps :: forall a. Data a => ProgramFile (Analysis a) -> ProgramFile (Analysis a) -- | Annotate AST with constant-expression information based on given -- ParameterVarMap. analyseParameterVars :: forall a. Data a => ParameterVarMap -> ProgramFile (Analysis a) -> ProgramFile (Analysis a) -- | Build a BlockMap from the AST. This can only be performed after -- analyseBasicBlocks has operated, created basic blocks, and labeled all -- of the AST-blocks with unique numbers. genBlockMap :: Data a => ProgramFile (Analysis a) -> BlockMap a -- | Build a DefMap from the BlockMap. This allows us to quickly look up -- the AST-block labels that wrote into the given variable. genDefMap :: Data a => BlockMap a -> DefMap -- | BlockMap : AST-block label -> AST-block Each AST-block has been -- given a unique number label during analysis of basic blocks. The -- purpose of this map is to provide the ability to lookup AST-blocks by -- label. type BlockMap a = ASTBlockNodeMap (Block (Analysis a)) -- | DefMap : variable name -> { AST-block label } type DefMap = Map Name ASTBlockNodeSet -- | Create a call map showing the structure of the program. genCallMap :: Data a => ProgramFile (Analysis a) -> CallMap -- | CallMap : program unit name -> { name of function or subroutine } type CallMap = Map ProgramUnitName (Set Name) -- | For each loop in the program, find out which bblock nodes are part of -- the loop by looking through the backedges (m, n) where n is considered -- the 'loop-header', delete n from the map, and then do a -- reverse-depth-first traversal starting from m to find all the nodes of -- interest. Intersect this with the strongly-connected component -- containing m, in case of improper graphs with weird control -- transfers. loopNodes :: Graph gr => BackEdgeMap -> gr a b -> [BBNodeSet] -- | Find the edges that 'loop back' in the graph; ones where the target -- node dominates the source node. If the backedges are viewed as (m -- -> n) then n is considered the 'loop-header' genBackEdgeMap :: Graph gr => DomMap -> gr a b -> BackEdgeMap -- | The strongly connected component containing a given node. sccWith :: Graph gr => Node -> gr a b -> [Node] -- | BackEdgeMap : bblock node -> bblock node type BackEdgeMap = BBNodeMap BBNode -- | Similar to loopNodes except it creates a map from loop-header to the -- set of loop nodes, for each loop-header. genLoopNodeMap :: Graph gr => BackEdgeMap -> gr a b -> LoopNodeMap -- | LoopNodeMap : bblock node -> { bblock node } type LoopNodeMap = BBNodeMap BBNodeSet -- | For each loop in the program, figure out the names of the induction -- variables: the variables that are used to represent the current -- iteration of the loop. genInductionVarMap :: Data a => BackEdgeMap -> BBGr (Analysis a) -> InductionVarMap -- | Map of loop header nodes to the induction variables within that loop. type InductionVarMap = BBNodeMap (Set Name) -- | Generate an induction variable map that is indexed by the labels on -- AST-blocks within those loops. genInductionVarMapByASTBlock :: forall a. Data a => BackEdgeMap -> BBGr (Analysis a) -> InductionVarMapByASTBlock -- | InductionVarMapByASTBlock : AST-block label -> { name } type InductionVarMapByASTBlock = ASTBlockNodeMap (Set Name) -- | For every expression in a loop, try to derive its relationship to a -- basic induction variable. genDerivedInductionMap :: forall a. Data a => BackEdgeMap -> BBGr (Analysis a) -> DerivedInductionMap type DerivedInductionMap = ASTExprNodeMap InductionExpr data InductionExpr IETop :: InductionExpr IELinear :: !Name -> !Int -> !Int -> InductionExpr IEBottom :: InductionExpr -- | Show some information about dataflow analyses. showDataFlow :: (Data a, Out a, Show a) => ProgramFile (Analysis a) -> String -- | Outputs a DOT-formatted graph showing flow-to data starting at the -- given AST-Block node in the given Basic Block graph. showFlowsDOT :: (Data a, Out a, Show a) => ProgramFile (Analysis a) -> BBGr (Analysis a) -> ASTBlockNode -> Bool -> String type BBNodeMap = IntMap type BBNodeSet = IntSet type ASTBlockNodeMap = IntMap type ASTBlockNodeSet = IntSet type ASTExprNodeMap = IntMap type ASTExprNodeSet = IntSet instance Data.Data.Data Language.Fortran.Analysis.DataFlow.InductionExpr instance GHC.Generics.Generic Language.Fortran.Analysis.DataFlow.InductionExpr instance GHC.Classes.Ord Language.Fortran.Analysis.DataFlow.InductionExpr instance GHC.Classes.Eq Language.Fortran.Analysis.DataFlow.InductionExpr instance GHC.Show.Show Language.Fortran.Analysis.DataFlow.InductionExpr instance Data.Data.Data Language.Fortran.Analysis.DataFlow.IEFlow instance GHC.Generics.Generic Language.Fortran.Analysis.DataFlow.IEFlow instance GHC.Classes.Ord Language.Fortran.Analysis.DataFlow.IEFlow instance GHC.Classes.Eq Language.Fortran.Analysis.DataFlow.IEFlow instance GHC.Show.Show Language.Fortran.Analysis.DataFlow.IEFlow instance Control.DeepSeq.NFData Language.Fortran.Analysis.DataFlow.IEFlow instance Control.DeepSeq.NFData Language.Fortran.Analysis.DataFlow.InductionExpr -- | Format of Camfort precompiled files with information about Fortran -- modules. The ModuleMap stores information important to the -- renamer. The other data is up to you. -- -- Note that the encoder and decoder work on lists of ModFile so that one -- fsmod-file may contain information about multiple Fortran files. -- -- One typical usage might look like: -- --
-- let modFile1 = genModFile programFile -- let modFile2 = alterModFileData (const (Just ...)) "mydata" modFile1 -- let bytes = encodeModFile [modFile2] -- ... -- case decodeModFile bytes of -- Left error -> print error -- Right modFile3:otherModuleFiles -> ... -- where -- moduleMap = combinedModuleMap (modFile3:otherModuleFiles) -- myData = lookupModFileData "mydata" modFile3 -- renamedPF = analyseRenamesWithModuleMap moduleMap programFile --module Language.Fortran.Util.ModFile -- | Standard ending of fortran-src-format "mod files" modFileSuffix :: String -- | The data stored in the "mod files" data ModFile -- | A set of decoded mod files. type ModFiles = [ModFile] -- | Starting point. emptyModFile :: ModFile -- | Empty set of mod files. (future proof: may not always be a list) emptyModFiles :: ModFiles -- | Looks up the raw "other data" that may be stored in a ModFile by -- applications that make use of fortran-src. lookupModFileData :: String -> ModFile -> Maybe ByteString -- | Get a list of the labels present in the "other data" of a ModFile. -- More of a meta-programming / debugging feature. getLabelsModFileData :: ModFile -> [String] -- | Allows modificationinsertiondeletion of "other data" that may -- be stored in a ModFile by applications that make use of fortran-src. -- See alter for more information about the interface of this -- function. alterModFileData :: (Maybe ByteString -> Maybe ByteString) -> String -> ModFile -> ModFile -- | Generate a fresh ModFile from the module map, declaration map and type -- analysis of a given analysed and renamed ProgramFile. genModFile :: forall a. Data a => ProgramFile (Analysis a) -> ModFile -- | Extracts the module map, declaration map and type analysis from an -- analysed and renamed ProgramFile, then inserts it into the ModFile. regenModFile :: forall a. Data a => ProgramFile (Analysis a) -> ModFile -> ModFile -- | Convert ModFiles to a strict ByteString for writing to file. encodeModFile :: [ModFile] -> ByteString -- | Convert a strict ByteString to ModFiles, if possible. Revert the -- String aliases according to the StringMap. decodeModFile :: ByteString -> Either String [ModFile] -- | A map of aliases => strings, in order to save space and share -- structure for repeated strings. type StringMap = Map String String -- | Map of unique variable name to the unique name of the program unit -- where it was defined, and the corresponding SrcSpan. type DeclMap = Map Name (DeclContext, SrcSpan) -- | A map of variables => their constant expression if known type ParamVarMap = ParameterVarMap -- | Context of a declaration: the ProgramUnit where it was declared. data DeclContext DCMain :: DeclContext DCBlockData :: DeclContext DCModule :: ProgramUnitName -> DeclContext -- | (uniqName, srcName) DCFunction :: (ProgramUnitName, ProgramUnitName) -> DeclContext -- | (uniqName, srcName) DCSubroutine :: (ProgramUnitName, ProgramUnitName) -> DeclContext -- | Extract all module maps (name -> environment) by collecting all of -- the stored module maps within the PUModule annotation. extractModuleMap :: forall a. Data a => ProgramFile (Analysis a) -> ModuleMap -- | Extract map of declared variables with their associated program unit -- and source span. extractDeclMap :: forall a. Data a => ProgramFile (Analysis a) -> DeclMap -- | Get the associated Fortran filename that was used to compile the -- ModFile. moduleFilename :: ModFile -> String -- | Extract the combined string map of ModFiles. Mainly internal use. combinedStringMap :: ModFiles -> StringMap -- | Extract the combined declaration map from a set of ModFiles. Useful -- for parsing a Fortran file in a large context of other modules. combinedDeclMap :: ModFiles -> DeclMap -- | Extract the combined module map from a set of ModFiles. Useful for -- parsing a Fortran file in a large context of other modules. combinedModuleMap :: ModFiles -> ModuleMap -- | Extract the combined module map from a set of ModFiles. Useful for -- parsing a Fortran file in a large context of other modules. combinedTypeEnv :: ModFiles -> TypeEnv -- | Extract the combined string map of ModFiles. Mainly internal use. combinedParamVarMap :: ModFiles -> ParamVarMap -- | Create a map that links all unique variable/function names in the -- ModFiles to their corresponding filename. genUniqNameToFilenameMap :: ModFiles -> Map Name String -- | Status of mod-file compared to Fortran file. data TimestampStatus NoSuchFile :: TimestampStatus CompileFile :: TimestampStatus ModFileExists :: FilePath -> TimestampStatus -- | Compare the source file timestamp to the fsmod file timestamp, if it -- exists. checkTimestamps :: FilePath -> IO TimestampStatus instance GHC.Generics.Generic Language.Fortran.Util.ModFile.DeclContext instance Data.Data.Data Language.Fortran.Util.ModFile.DeclContext instance GHC.Show.Show Language.Fortran.Util.ModFile.DeclContext instance GHC.Classes.Eq Language.Fortran.Util.ModFile.DeclContext instance GHC.Classes.Ord Language.Fortran.Util.ModFile.DeclContext instance GHC.Generics.Generic Language.Fortran.Util.ModFile.ModFile instance Data.Data.Data Language.Fortran.Util.ModFile.ModFile instance GHC.Show.Show Language.Fortran.Util.ModFile.ModFile instance GHC.Classes.Ord Language.Fortran.Util.ModFile.ModFile instance GHC.Classes.Eq Language.Fortran.Util.ModFile.ModFile instance Data.Binary.Class.Binary Language.Fortran.Util.ModFile.ModFile instance Data.Binary.Class.Binary Language.Fortran.Util.ModFile.DeclContext module Language.Fortran.Transformer transform :: Data a => [Transformation] -> ProgramFile a -> ProgramFile a transformWithModFiles :: Data a => ModFiles -> [Transformation] -> ProgramFile a -> ProgramFile a data Transformation GroupForall :: Transformation GroupIf :: Transformation GroupCase :: Transformation GroupDo :: Transformation GroupLabeledDo :: Transformation DisambiguateFunction :: Transformation DisambiguateIntrinsic :: Transformation instance GHC.Classes.Eq Language.Fortran.Transformer.Transformation module Language.Fortran.Parser.Fortran95 functionParser :: LexAction (ProgramUnit A0) statementParser :: LexAction (Statement A0) fortran95Parser :: ByteString -> String -> ParseResult AlexInput Token (ProgramFile A0) fortran95ParserWithModFiles :: ModFiles -> ByteString -> String -> ParseResult AlexInput Token (ProgramFile A0) module Language.Fortran.Parser.Fortran90 statementParser :: LexAction (Statement A0) functionParser :: LexAction (ProgramUnit A0) fortran90Parser :: ByteString -> String -> ParseResult AlexInput Token (ProgramFile A0) fortran90ParserWithModFiles :: ModFiles -> ByteString -> String -> ParseResult AlexInput Token (ProgramFile A0) module Language.Fortran.Parser.Fortran77 expressionParser :: LexAction (Expression A0) statementParser :: LexAction (Statement A0) fortran77Parser :: ByteString -> String -> ParseResult AlexInput Token (ProgramFile A0) extended77Parser :: ByteString -> String -> ParseResult AlexInput Token (ProgramFile A0) legacy77Parser :: ByteString -> String -> ParseResult AlexInput Token (ProgramFile A0) includeParser :: FortranVersion -> ByteString -> String -> ParseResult AlexInput Token [Block A0] fortran77ParserWithModFiles :: ModFiles -> ByteString -> String -> ParseResult AlexInput Token (ProgramFile A0) extended77ParserWithModFiles :: ModFiles -> ByteString -> String -> ParseResult AlexInput Token (ProgramFile A0) legacy77ParserWithModFiles :: ModFiles -> ByteString -> String -> ParseResult AlexInput Token (ProgramFile A0) legacy77ParserWithIncludes :: [String] -> ByteString -> String -> IO (ParseResult AlexInput Token (ProgramFile A0)) module Language.Fortran.Parser.Fortran66 expressionParser :: LexAction (Expression A0) statementParser :: LexAction (Statement A0) fortran66Parser :: ByteString -> String -> ParseResult AlexInput Token (ProgramFile A0) fortran66ParserWithModFiles :: ModFiles -> ByteString -> String -> ParseResult AlexInput Token (ProgramFile A0) module Language.Fortran.Parser.Fortran2003 functionParser :: LexAction (ProgramUnit A0) statementParser :: LexAction (Statement A0) fortran2003Parser :: ByteString -> String -> ParseResult AlexInput Token (ProgramFile A0) fortran2003ParserWithModFiles :: ModFiles -> ByteString -> String -> ParseResult AlexInput Token (ProgramFile A0) module Language.Fortran.Parser.Any type Parser = ByteString -> String -> Either ParseErrorSimple (ProgramFile A0) parserVersions :: [(FortranVersion, Parser)] type ParserWithModFiles = ModFiles -> ByteString -> String -> Either ParseErrorSimple (ProgramFile A0) parserWithModFilesVersions :: [(FortranVersion, ParserWithModFiles)] after :: (b -> c) -> (t -> a -> b) -> t -> a -> c -- | Deduce the type of parser from the filename and parse the contents of -- the file. fortranParser :: Parser -- | Deduce the type of parser from the filename and parse the contents of -- the file, within the context of given "mod files". fortranParserWithModFiles :: ParserWithModFiles -- | Given a FortranVersion, parse the contents of the file. fortranParserWithVersion :: FortranVersion -> Parser -- | Given a FortranVersion, parse the contents of the file, within the -- context of given "mod files". fortranParserWithModFilesAndVersion :: FortranVersion -> ParserWithModFiles -- | Generate a module use-graph. module Language.Fortran.Analysis.ModGraph genModGraph :: Maybe FortranVersion -> [FilePath] -> [FilePath] -> IO ModGraph data ModGraph ModGraph :: Map String (Node, Maybe ModOrigin) -> Gr String () -> Int -> ModGraph [mgModNodeMap] :: ModGraph -> Map String (Node, Maybe ModOrigin) [mgGraph] :: ModGraph -> Gr String () [mgNumNodes] :: ModGraph -> Int data ModOrigin MOFile :: FilePath -> ModOrigin MOFSMod :: FilePath -> ModOrigin modGraphToDOT :: ModGraph -> String takeNextMods :: ModGraph -> [(Node, Maybe ModOrigin)] delModNodes :: [Node] -> ModGraph -> ModGraph instance GHC.Show.Show Language.Fortran.Analysis.ModGraph.ModOrigin instance Data.Data.Data Language.Fortran.Analysis.ModGraph.ModOrigin instance GHC.Classes.Eq Language.Fortran.Analysis.ModGraph.ModOrigin instance Data.Data.Data Language.Fortran.Analysis.ModGraph.ModGraph instance GHC.Classes.Eq Language.Fortran.Analysis.ModGraph.ModGraph instance GHC.Classes.Ord Language.Fortran.Analysis.ModGraph.ModOrigin