Skip to content

cicr99/Grammar-Analyser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Grammar-Analyser

This project takes a given input and then transforms it into a grammar. This grammar is analyzed in order to perform various processes:

  • If possible, it generates parsers LL(1), SLR(1), LR(1), LALR(1).
  • It builds the derivation tree of a given string if it belongs to the language generated by the grammar
  • It shows possible conflict strings for the generated parsers, only in case some of them present conflicts
  • It analyzes if the given grammar is regular; if so, it generates the automaton and the regular expression that represent the grammar.

Starting

To use the project, clone it or download it to your local computer.

Requirements 📋

It is necessary to have python v-3.7.2, pydot, streamlit, graphviz and some web navegator as chrome or firefox installed to make full use of the application's functionalities.

Mode of use

To execute the project, just open the console from the root location of the project and execute:

streamlit run main.py

The grammar must be inserted in the following way:

Distinguido = <id, 'id_name'>
NoTerminales = [ <id, 'id_name'>, <id, 'id_name'>, ⋯, <id, 'id_name'> ]
Terminales = [ <id, 'id_name'>, <id, 'id_name'>, ⋯, <id, 'id_name'> ]
S = a1 + a2 + ⋯ + ak

The last line represents productions, where S is a non_terminal symbol and a1 + a2 + ⋯ + ak represents a sentence. If there is more than one production asociated with the same non-terminal symbol, it is possible to write them separated by ; instead of in a different line.

To insert a string in order to build the corresponding derivation tree, it is necessary that all the symbols of the string are separated by a blank space. Also the program expects a string that belongs to the language generated by the grammar, so if it doesn't it will raise an unexpected error.

Authors ✒️

  • Carmen Irene Cabrera Rodríguez - cicr99
  • Enrique Martínez González - kikeXD

License

This project is under the License (MIT License) - see the file LICENSE.md for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages