lexical analyzer for python in python
python 2.7
To run the lexical analyzer on a python file you need to add the file in the same directory. For example
there is an file titled example.py. To run the lexical analyzer on this file, use the terminal and run
python analyze.py
then the program waits for a file name to be entered, so enter example.py
and the output will be the lexical analysis of the python file example.py. You can analyze any python file
to get the lexical analysis.
- Lexical Analysis
- Empty input file handling
- File doesn't exist handling
- Finds strings of any length
- Correctly handles comments on their own line or a line with code
- Punctuation is found
- Keywords are found
- ID's are found
- Getting ID lexical errors