FLCT – lab 2

Lab2 – assigned in week 5, due in week 7

Regular grammars and finite automata

Write a program that:
1. reads a grammar (from the keyboard and from a file);
2. displays the elements of a grammar, using a menu: the set of non-terminals, the set of terminals, the set of productions, the productions of a given non-terminal symbol;
3. verifies if the grammar is regular;
4. reads the elements of a finite automaton (from the keyboard and from a file);
5. displays the elements of a finite automaton, using a menu: the set of states, the alphabet, all the transitions, the set of final states;
6. given a regular grammar, constructs the corresponding finite automaton;
7. given a finite automaton, constructs the corresponding regular grammar.