-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_flex.cpp
More file actions
38 lines (33 loc) · 1.17 KB
/
Copy pathtest_flex.cpp
File metadata and controls
38 lines (33 loc) · 1.17 KB
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
#include <math.h>
#include <iostream>
#include "string.h"
#include "opnum.h"
#include "stack.h"
#include <vector>
using namespace std;
using namespace cop4530;
int main(int argc, char **argv)
{
int retval = SYM_NULL;
set_input(argc, argv);
do {
char * opnum = get_opnum(&retval);
if (retval) {
switch (retval)
{
case SYM_NAME: cout<<"ID: "; cout <<opnum<<endl; break;
case SYM_INTEG: cout<<"Integer: ";cout <<opnum<<endl; break;
case SYM_FLOAT: cout<<"Float: "; cout <<opnum<<endl; break;
case SYM_ADD: cout<<"Op: "; cout <<opnum<<endl; break;
case SYM_SUB: cout<<"Op: "; cout <<opnum<<endl; break;
case SYM_MUL: cout<<"Op: "; cout <<opnum<<endl; break;
case SYM_DIV: cout<<"Op: "; cout <<opnum<<endl; break;
case SYM_OPEN: cout<<"left Par: "; cout <<opnum<<endl; break;
case SYM_CLOSE: cout<<"Right Par: "; cout <<opnum<<endl; break;
case SYM_INVAL: cout<<"Invalid: "; cout <<opnum<<endl; break;
case SYM_NEWLINE: break;
default: break;
}
}
} while (retval > SYM_NULL);
}