GithubHelp home page GithubHelp logo

ll1's Introduction

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 ๐Ÿ˜•

ll1's People

Contributors

bluegob avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

sadman59m zheyifu

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.