QCaml/Basis/GamessReader.ml

18 lines
362 B
OCaml
Raw Permalink Normal View History

2018-03-13 18:24:00 +01:00
(** Reads a basis set in GAMESS format *)
2018-03-06 18:25:48 +01:00
let read_basis filename =
2018-02-23 18:44:31 +01:00
let lexbuf =
let ic = open_in filename in
Lexing.from_channel ic
in
let rec aux accu =
try
let key, basis =
GamessParser.input BasisLexer.read_all lexbuf
in
aux ((key, basis)::accu)
with
| Parsing.Parse_error -> List.rev accu
in
aux []