Debian Codegraph @

packages/seacas/libraries/ioss/src/visualization/catalyst/parser/parse_phactori.cxx

raw
1 // Copyright(C) 1999-2021 National Technology & Engineering Solutions
2 // of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
3 // NTESS, the U.S. Government retains certain rights in this software.
4 //
5 // See packages/seacas/LICENSE for details
6
7 #include "PhactoriParserInterface.h"
8 #include <fstream>
9 #include <iostream>
10 #include <stdlib.h>
11
12 int main(int argc, char **argv) {
13
14 if (argc != 2) {
15 std::cerr << "Usage: parse_phactori" << " FILE\n\n";
16 std::cerr << "DESCRIPTION\n\n";
17 std::cerr << "Parses input FILE and writes JSON result to "
18 << "standard output.\n\n";
19 std::cerr << "FILE\n\n";
20 std::cerr << "File containing Phactori input syntax.\n";
21 exit(1);
22 }
23
24 Iovs::PhactoriParserInterface::ParseInfo pinfo;
25 Iovs::PhactoriParserInterface::parseFile(argv[1], pinfo);
26 if (pinfo.parseFailed) {
27 std::cerr << "Parse of input file failed.\n";
28 }
29 else {
30 std::cout << pinfo.jsonParseResult << "\n";
31 }
32 exit(pinfo.parseFailed);
33 }