-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.cpp
More file actions
34 lines (27 loc) · 823 Bytes
/
test.cpp
File metadata and controls
34 lines (27 loc) · 823 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include <iostream>
#include <sstream>
using namespace std;
#include "tools/nts2Nts.h"
nts::Nts* nts_to_Nts( nts_parser::nts nn ) {
nts_2_Nts Nn( nn );
return Nn.n;
}
template< typename T >
nts_parser::eref< T > file_to( const char* file ) {
stream_range in( file );
auto const q_parser = nts_parser::commented_first
&& nts_parser::parser< T >
&& nts_parser::is_last;
nts_parser::eref< T > q {};
typename stream_range::iterator i = in.first;
if ( !q_parser( i, in, &q ) )
std::cerr << "Parser Error.\n";
return q;
}
nts::Nts* file_to_Nts( const char* file ) {
return nts_to_Nts( nts_parser::deitemise( file_to< nts_parser::nts >( file ) ) );
}
int main( int argc, char** argv ) {
auto p = file_to_Nts( argv[ 1 ] );
std::cout << *p << std::endl;
}