Group Assignment (20%)
Given a C++ program develop a lexer which will be able to identify and return all the
possible tokens available in either of the following cases
Recognize and categorize tokens from the following constructs:
1. Standard Input/Output 6. Function Definitions
2. Arithmetic Expressions 7. Structure Definitions
3. Relational Expressions 8. Variable Initialization
4. Logical Expressions 9. Repetition Statements
5. Array Initialization 10. Conditional Statements
Compile and run the lexer using the command line
Provide the output for a sample C++ program using the lexer.
Assignment Requirements:
1. Flex Source File (lexer.l)
Must contain regex rules for token categories listed above.
2. Sample C++ Program (sample.cpp)
Should one of the 10 titles.
3. ReadMe File (README.txt)
Steps to compile and run using Flex and GCC on terminal or CMD.
4. Output File (output.txt)
Copy-paste the output of the screen sheet from running the lexer with sample.cpp.
Submission Deadline: 30/11/2017E.C