bc210424835 cs606 Assignment 1 Solution
bc210424835 cs606 Assignment 1 Solution
Assignment # 01
Consider the following stream of characters as input to the lexical analyzer (i.e., scanner);
You are required to find the tokens produced by lexical analyzer and write them along with their
types (types are given below) in the following sample table.
1. for Keyword
2. ( Symbol
3. int Keyword
4. i Identifier
5. = Symbol
6. 0 Integer
7. ; Symbol
8. i Identifier
9. < Symbol
10. 10 Integer
11. ; Symbol
12. i Identifier
13. ++ Symbol
14. ) Symbol
15. { Symbol
16. if Keyword
17. ( Symbol
18. i Identifier
19. % Symbol
20. 2 Integer
21. == Symbol
22. 0 Integer
23. ) Symbol
24. { Symbol
29. i Identifier
30. << Symbol
32. ; Symbol
33. } Symbol
35. { Symbol
40. i Identifier
43. ; Symbol
44. } Symbol
45. } Symbol