]> pd.if.org Git - pccts/blob - testcpp/6/main.cpp
auto commit for import
[pccts] / testcpp / 6 / main.cpp
1 /* we must define ANTLRTokenType, but it will be different for parsers A and B;
2  * so, we just define it as an 'int', which is bad, but we can do nothing
3  * else.
4  */
5 #include <stdio.h>
6 #include <stdlib.h>
7 #include "A/tokens.h"
8 #include "A.h"
9 #include "B.h"
10 #include "ALexer.h"
11 #include "BLexer.h"
12
13 #include "PBlackBox.h"
14
15 typedef ANTLRCommonToken ANTLRToken;
16
17 int main(int argc, char *argv[])
18 {
19         ANTLRToken aToken;              /* create a token to fill in for DLG */
20         DLGFileInput in(stdin);
21
22         if ( argc!=3 ) {
23             fprintf(stderr, "usage: t file1 file2\n");
24             exit(EXIT_SUCCESS);
25         }
26
27         ParserBlackBox<ALexer, A, ANTLRToken> p1(argv[1]);
28         p1.parser()->e();
29         
30         ParserBlackBox<BLexer, B, ANTLRToken> p2(argv[2]);
31         p2.parser()->e();
32
33 /*
34         ALexer scan1(&in,2000);
35         ANTLRTokenBuffer pipe1(&scan1);
36         scan1.setToken(&aToken);
37         A parser1(&pipe1);
38         parser1.init();
39         parser1.e();
40
41         BLexer scan2(&in,2000);
42         ANTLRTokenBuffer pipe2(&scan2);
43         scan2.setToken(&aToken);
44         B parser2(&pipe2);
45         parser2.init();
46         parser2.e();
47 */
48
49         return 0;
50 }