Implement Lexical analyzer

124 views 10:43 am 0 Comments August 5, 2023

[Compiler] [Python] Implement Lexical analyzer using PLY (Python Lex-Yacc: github.com/dabeaz/ply) – Read input from the input file. – Support real numbers in both the decimal and scientific notation. – A variable should start with any character and may follow by any alphanumeric character or underscore. – Supported operators are – Any number of whitespace characters between tokens and operators is valid e.g. 2 +3== 5 – Only one assignment per one input line. – Output file in plain text with “tok” extension. (e.g. output.tok) – Testcase: drive.google.com/file/d/1J1GjIbFrQ7REHHPTjTNKXJmHy7RJq2dq/view?usp=sharing Each line in the output file should be in the following format: For example,

Tags: , , , , , , , , , , ,