10
1
mirror of https://gitlab.com/scemama/QCaml.git synced 2024-11-15 18:43:40 +01:00
QCaml/Basis/Gamess_reader.ml

19 lines
467 B
OCaml
Raw Normal View History

2018-01-17 15:56:57 +01:00
(** Read a basis set file in GAMESS format and return an association list where the key is an
Element.t and the value is the parsed basis set. *)
let read ~filename =
let lexbuf =
let ic = open_in filename in
Lexing.from_channel ic
in
let rec aux accu =
try
2018-01-19 03:14:06 +01:00
let key, basis =
2018-01-17 15:56:57 +01:00
Gamess_parser.input Basis_lexer.read_all lexbuf
in
aux ((key, basis)::accu)
with
| Parsing.Parse_error -> List.rev accu
in
aux []