Write a parser & a type checker for a small language
In this project, you are asked to write a parser and a type checker for a small language. The parser
checks that the input is syntactically correct and the type checker enforces the semantic rules of the
language. The semantic rules that your program will enforce relate to declarations and types. In addition, your program will check for unused variables and for the use of uninitialized variables and outputs
corresponding error messages.
The input to your code will be a program and the output will be:
• syntax error message if the input program is not syntactically correct
• if the input program has no syntax error, the output is:
– semantic error messages if there is a declaration error or a type mismatch in the input program,
– error messages if there are variables that are declared but never used or variables that are
used before they are assigned a value, or
– information about the types of the symbols declared in the input program if there is no semantic error
The post Write a parser & a type checker for a small language appeared first on My Assignment Online.
