https://github.com/bluegob/ll1
LL1 parser / analyseur syntaxique descendant LL1
https://github.com/bluegob/ll1
c ll1-parser
Last synced: about 1 year ago
JSON representation
LL1 parser / analyseur syntaxique descendant LL1
- Host: GitHub
- URL: https://github.com/bluegob/ll1
- Owner: BlueGob
- Created: 2022-04-23T07:38:59.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-05-13T21:19:50.000Z (about 4 years ago)
- Last Synced: 2025-04-09T09:51:49.079Z (about 1 year ago)
- Topics: c, ll1-parser
- Language: C
- Homepage:
- Size: 42 KB
- Stars: 5
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Descent Parser
## LL1 parser with C
A small LL1 analyser that can remove recusrsion, calculate the first and follow of a given production rules then you can enter a word to analyse it.
## how to use
### syntax
- terminal must be lower case
- non-terminals must be upper case
- terminals and non-terminals should be one character at most
- epsilon are represented by the character '&'
### install and run
```
gcc LL_1_parser.c -o LL1
./LL1
```
### exemple
#### remove recursion ,calculate first and follow
after running you can type the following production rules as an exemple :
E->E+T|T
T->T\*F|F
F->(E)|d
**.**
when u finish typing your prodution rules you need to type '.' then press enter

- this is the result of the first step of the execution
#### analyse a given word
now we jump to next step wich is verifying a given word matching our production rules (grammar) or not.
so we type this word for exemple:
(d+d)\*(d+d)
*note*: non-terminal characters must be the same as the non-terminals entred in the production rules.
for exemple the word ~~(5+5)*5~~ will not be accepted despite it is correct instead you should type (d+d)\*d

as we can see it tell's us that this word is accepted !.
sorry for the one file code 😕