bulk of lexer/parser, based on Parametric Fortran by Martin Erwig
updated for cabal build