#parser #format #utilities #level #nuclear-data #endf-6

endf_parser

A Rust library for parsing ENDF-6 format nuclear data

3 unstable releases

0.2.0 Apr 6, 2020
0.1.1 Mar 29, 2020
0.1.0 Mar 29, 2020

#1971 in Parser implementations

MIT license

69KB
1.5K SLoC

endf-parser.rs

Travis master branch Travis develop branch GitHub release Crates.io API

endf-parser.rs is a rust library providing utilities for parsing ENDF-6 format nuclear data.

Basics

Level 1

Level 1 is used to parse ENDF primitives. It includes:

  • integers
  • reals
  • text
// Parse ENDF integer
fn main() -> Result<i64, ParseEndfIntegerError> {
    endf_parser::primitive::integer::parse("    -123456")
}
// Parse ENDF real
fn main() -> Result<i64, ParseEndfRealError> {
    endf_parser::primitive::real::parse("-1.23456+12")
}

Level 2

Level 2 is for parsing ENDF records. It includes following records:

  • CONT
  • DIR
  • HEAD
  • LIST
  • TAB1
  • TEXT
fn main() -> Result<Cont, ParseEndfRecordError> {
    endf_parser::record::cont::Cont::parse(
    "-1.23456789+1.23456789          1         12        123       123412341212312345\n"
    )
}

Questions, Issues, Contributing

Contributions and Pull Request are welcome.

For questions and issues, open an issue here.

License

MIT License

No runtime deps