Homework: Write a program in Java that simulates the work of the vocabulary analyzer phase (which represents the first phase of the author phases), that is, it combines symbols together to form a specific paragraph according to the existing scheme.
Input: a set of lines using a text file (Text File).
Outputs: two tables (paragraph table + symbol table)
1) - The first table (table of paragraphs) includes: Paragraph name + Paragraph value
2) - The second table (the symbol table) includes: The names of the identifiers mentioned in the entered program.
Note: The keywords are (int, for, while, float) only.
Example: If the entry is "Sum = 31 x>=y output", then the output will be:
1) - Items (token) Table:
- Sum Ident = Arith_Opr
- 31 IntegerNum
- x Ident >= Rel_Opr
- Y Ident
2) - Symbol Table: The designed program collects symbols and categorizes paragraphs according to the micro-rules shown in the diagram below: 11.49 AMv.