-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScanner.h
More file actions
43 lines (39 loc) · 827 Bytes
/
Scanner.h
File metadata and controls
43 lines (39 loc) · 827 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
//scanner
#ifdef SCANNER_
#define SCANNER_
#include <iostream>
#include <fstream>
using namespace std;
class scanner { // AKA the inputStream
//constructor
/*
int lineNumber, index;
string fileContents;
scanner (string fileName){
int lineNumber = 1;
int index = 0;
ifstream is (fileName);
char c;
while (is.get(c)){
fileContents =fileContents + c;
if (c = '\n'){
lineNumber++;
}
}
is.close;
}
//pass in file name
//open
//read 1 char by 1 char
//make it into a STRING
*/
char currentChar(){
//if index>= string.length --> return -1
//else return index
}
void advance (){
//if past end of line --> do nothing
//if index = \n (newline) --> line_number++ index++
}
};
#endif scanner