-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprogram1.cpp
More file actions
45 lines (36 loc) · 866 Bytes
/
program1.cpp
File metadata and controls
45 lines (36 loc) · 866 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
35
36
37
38
39
40
41
42
43
44
45
/*
* program1.cpp
* Author: Wyatt Emery
* Date: SEP 6, 2017
*
* COSC 4785, Homework1
*
*/
#include<iostream>
#include<FlexLexer.h>
#include<string>
#include"program1.h"
using namespace std;
int main()
{
yyFlexLexer myScanner;
int rtn = 0;
bool firstScan = true;
while((rtn=myScanner.yylex()) != 0)
{
if(firstScan)
{
firstScan = false;
cout << "Line" << "\t" << "Column" << "\t" << "Type" << "\t" << "Length"
<< "\t" << "Value" << endl;
}
cout << token.line << "\t";
cout << token.column << "\t";
cout << (rtn - 10) << "\t";
cout << token.value.length() << "\t";
if((rtn != SPACE) && (rtn != TAB) && (rtn != NEWLINE))
cout << token.value;
cout << endl;
}
return 0;
}