-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
40 lines (27 loc) · 1.58 KB
/
README
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
Wesley Lancaster
dev specifications:
IntelliJ IDEA 2022.3.2 (Community Edition)
15 Oracle Open JDK version 15
Compile using the following command:
javac lexicalyzer.java
Run using the following command
javac lexicalyzer
Program usage:
the user will be prompter to enter the location of the file that user wants to be read.
------------------------------------------------------------------------------------
IMPORTANT NOTE:
Its important to note that while my program does utilize a scanner,
it only uses the scanner to read each LINE of the text file, which it then saves in a string called text.
I wrote my own .next() and .hasNext() method for reading lexemes in each line.
Basic Description:
My program reads the text file into a scanner, which then reads each line into a string,
which then calls its own .nextLine() and saves it into a String lexeme to be passed to .position() .value() and .kind()
to be analyzed.
Known issues:
-A deep looping issue is causing my code to read words/ lexemes in a peculiar way that can be annoying.
At its worst, it simply causes my code to sometimes reread lexemes.
This issue (for reasons far beyond my ability to understand) causes my .next() to repeat, or chop up words rarely and randomly.
Testing, by replacing my .next() method with the scanner's .next() confirms that the issue is with my code.
But after rewriting my .next() methods like 10 times, I really am not sure how my issue is possible.
-There are still a few instances where you can trick my code. EX:
'int' is keyword. 'intt' is a misspelled keyword unless its an ID. but 'in' will always be an id.