Skip to content
/ LL1 Public

LL1 parser / analyseur syntaxique descendant LL1

Notifications You must be signed in to change notification settings

BlueGob/LL1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 

Repository files navigation

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

capt

  • 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

cap

as we can see it tell's us that this word is accepted !.

sorry for the one file code 😕

About

LL1 parser / analyseur syntaxique descendant LL1

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages