Consider the following grammar for variable declarations:
- <vardecl> $\rightarrow$ <vardecl><idlist> : <type>;
- <vardecl> $\rightarrow \in$
- <idlist> $\rightarrow$ <idlist>, id
- <idlist> $\rightarrow$ id
- <type> $\rightarrow$ integer
- <type> $\rightarrow$ real
Write a syntax - directed translation scheme to install the identifiers into the symbol table. You must also issue appropriate error messages wherever necessary. Make suitable assumptions regarding procedures operating on the symbol table; you need not elaborate upon these procedures.