Program for Analysis of Context-free Grammars

Abstract

This thesis presents the extension and enhancement of a desktop application designed for manipulating context-free grammars, originally developed as a semestral project for the Master of Computer Science degree. The initial application served as a practical tool, offering a user-friendly interface for grammar entry, modification, and derivation construction, with features including sequential sentential forms and graphical derivation trees. Building upon this foundation, the thesis introduces new functionalities aimed at extending the analysis and transformation capabilities of the application. The extended application now encompasses advanced grammar optimization techniques, including the reduction of given grammars by eliminating useless nonterminals and unreachable rules, as well as the removal of epsilon and unit rules. Additionally, transformations to Chomsky normal form and Greibach normal form have been implemented, with detailed step-by-step explanations provided to aid user comprehension. Users are empowered to save the transformed grammars to text files, facilitating further analysis. Moreover, the application now offers robust analysis capabilities, including the computation of FIRST and FOLLOW sets, essential for parsing algorithms, and the determination of the type of grammar (LR(0), SLR(1), LALR(1), LR(1), LL(1)). Visual representations of LR items, action, and goto tables are provided, alongside conflict detection mechanisms to assist users in identifying and resolving parsing ambiguities. By bridging the gap between user interaction and grammar manipulation, this comprehensive desktop application offers an accessible platform for exploring and understanding context-free grammars. Its newly added features not only enhance user experience but also deepen the application's utility in academic contexts.

Description

Subject(s)

context-free grammars, analysis of grammars, parsing, user-friendly application

Citation