fortran-vars-0.4.0: Fortran memory model and other static analysis tools.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Language.Fortran.Vars.Eval

Synopsis

Documentation

eval :: SymbolTable -> Expression a -> ExpVal Source #

Given a SymbolTable and some Expression, evaluate that expression into a basic type and return it as an ExpVal.

eval' :: SymbolTable -> Expression a -> Either String ExpVal Source #

Given a SymbolTable and some Expression, attempt to evaluate that expression into a value in fortran-src's representation, translate it into an ExpVal, and return.

evalWithShortcircuit :: SymbolTable -> Expression a -> Either String ExpVal Source #

Given a SymbolTable and some Expression, evaluate that expression into a basic type and return it as an ExpVal or a String describing the issue that prevented the evaluation. In the case of expressions like

      foobar .AND. .FALSE.
      .TRUE. .OR. .foobar

the expressions will be shortcircuited to produce

      .FALSE.
      .TRUE.