Skip to content

pmaini/LL1Parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

LL1Parser

LL1 parser implementation.
A program to generate an LL(1) parser for a given grammar and to parse input strings.

=>The input will give the number of productions in the grammar and each line will list one production.
=>Capital letters signify non-terminals and all other characters signify terminals.
=>The only exception is ‘e’ which signifies the empty string.
=>All terminals are one-character long.
=>Colon (:) demarcates the boundary between the left and right hand sides of a production.

example input:

8
E:TX
X:+TX
X:e
T:FY
Y:*FY
Y:e
F:a
F:(E)

example input string:
a+a*a

The output prints the sentential form in each step.

example output:
E
TX
FYX
aYX
aX
a+TX
a+FYX
a+aYX
a+aFYX
a+a
aYX
a+aaX
a+a
a

About

LL1 parser implementation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages