-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparser.cpp
More file actions
34 lines (29 loc) · 731 Bytes
/
parser.cpp
File metadata and controls
34 lines (29 loc) · 731 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 <type_traits>
#include <iostream>
#include <sstream>
#include "tools/data.h"
#include "tools/logic.h"
#include "parsers/globals.h"
using namespace std;
template< typename T >
eref< T > parse( char* file ) {
stream_range in( file );
auto const q_parser = commented_first
&& parser< T >
&& is_last;
eref< T > q {};
typename stream_range::iterator i = in.first;
if ( q_parser( i, in, &q ) )
cout << "ok" << endl;
else
cout << "nok" << endl;
return q;
}
int main( int argc, char** argv ) {
if ( argc <= 1 ) {
cerr << "no input files" << endl;
return 1;
}
cout << deitemise( parse< nts >( argv[ 1 ] ) ).print() << "foo" << endl;
return 0;
}