summaryrefslogtreecommitdiff
path: root/web/yacco2/o2testdriver/testdriver.cpp
blob: 773ee8a8e469091292b2977daac7b1ee7a5eb300 (plain)
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
/*6:*/
#line 132 "./testdriver.w"

/*3:*/
#line 36 "./testdriver.w"

#include "globals.h"
#include "yacco2_stbl.h"
using namespace yacco2_stbl;
#include "test_components.h"
#include "o2_externs.h"

/*:3*//*4:*/
#line 44 "./testdriver.w"

int RECURSION_INDEX__(0);

YACCO2_define_trace_variables();
yacco2::TOKEN_GAGGLE P3_tokens;
yacco2::TOKEN_GAGGLE Error_queue;
yacco2::TOKEN_GAGGLE tc_recycle_bin;
T_sym_tbl_report_card report_card;
std::string tc_file_to_compile;
STBL_T_ITEMS_type STBL_T_ITEMS;

yacco2::CHAR T_SW('n');
yacco2::CHAR ERR_SW('n');
yacco2::CHAR PRT_SW('n');
STATES_type LR1_STATES;
LR1_STATES_type LR1_COMMON_STATES;
bool LR1_HEALTH(LR1_COMPATIBLE);
int NO_LR1_STATES(0);
STATES_SET_type VISITED_MERGE_STATES_IN_LA_CALC;
CYCLIC_USE_TBL_type CYCLIC_USE_TABLE;


/*:4*//*5:*/
#line 67 "./testdriver.w"

int main(int argc,char*argv[]){
cout<<"Testdriver start"<<endl;
yacco2::lrclog<<"Testdriver start"<<endl;

LOAD_YACCO2_KEYWORDS_INTO_STBL();

GET_CMD_LINE(argc,argv,Yacco2_holding_file,Error_queue);
if(Error_queue.empty()!=true){
DUMP_ERROR_QUEUE(Error_queue);
return-1;
}
YACCO2_PARSE_CMD_LINE
(T_SW,ERR_SW,PRT_SW,tc_file_to_compile,Error_queue);

if(Error_queue.empty()!=true){
DUMP_ERROR_QUEUE(Error_queue);
return-1;
}
tok_can<std::ifstream> cmd_line(tc_file_to_compile.c_str());
if(cmd_line.file_ok()==NO){
cout<<"Error occurred file does not exist: "<<tc_file_to_compile.c_str()<<endl;
return 1;
}


yacco2::YACCO2_AR__= 1;

using namespace NS_test_components;
Ctest_components tc_fsm;
Parser tc(tc_fsm,&cmd_line,&P3_tokens,0,&Error_queue,&tc_recycle_bin,0);
tc.parse();

yacco2::TOKEN_GAGGLE::iterator i= P3_tokens.begin();
yacco2::TOKEN_GAGGLE::iterator ie= P3_tokens.end();
cout<<"Dump of P3 tokons"<<endl;
for(int yyy= 1;i!=ie;++i){
CAbs_lr1_sym*sym= *i;
if(sym==yacco2::PTR_LR1_eog__)continue;
cout<<yyy<<":: "<<sym->id()
<<" file no: "<<sym->external_file_id()
<<" line no: "<<sym->line_no()
<<" pos: "<<sym->pos_in_line()
<<endl;
yacco2::lrclog<<yyy<<":: "<<sym->id()
<<" file no: "<<sym->external_file_id()
<<" line no: "<<sym->line_no()
<<" pos: "<<sym->pos_in_line()
<<endl;
++yyy;
}
if(Error_queue.empty()!=true){
DUMP_ERROR_QUEUE(Error_queue);
cout<<"Testdriver exit"<<endl;
yacco2::lrclog<<"Testdriver exit"<<endl;
return-1;
}

exit:
cout<<"Testdriver exit"<<endl;
yacco2::lrclog<<"Testdriver exit"<<endl;
return 0;
}
/*:5*/
#line 133 "./testdriver.w"
;

/*:6*/