/Yacc-Parser-Addition-Rules-and-Type-Checking

An educational Yacc parser implementation for the specified grammar, featuring Java-like addition rules and integrated type checking for assignment consistency. Explore code, examples, and tests to deepen your understanding of Yacc parsing and semantic analysis.

Primary LanguagePython

Yacc-Parser-Addition-Rules-and-Type-Checking

Yacc parser tailored for this grammar:

S → def Type id = E E → E + E | Val Val → nb.nb | nb Type → int | float

This implementation incorporates Java-like addition rules and includes type checking to ensure consistent assignments. A valuable resource for educational activities, showcasing the implementation of semantic checks within parsing. Explore the code, examples, and tests to deepen your understanding of Yacc parsing and semantic analysis.