nobe4 / grammar.js

Grammar parsing and executing LL and SLR
1 stars 0 forks source link

grammar.js fork #15

Open diegoaguilar opened 9 years ago

diegoaguilar commented 9 years ago

Hello, I didnt' know the best way to contact you so I picked this. Maybe you've noticed that I've just forked your repo. Reason is I need to develop an app able to get the FIRST, FOLLOWING and PREDICTIVE sets from a grammar. I'd love if you could give an eye to my forked repo.

Thanks so much!

nobe4 commented 9 years ago

Hello, well I think my lib already do that (just as it was only an exercise I didn't take the time to create a proper structure).

The link I used for this is : http://www.jambe.co.nz/UNI/FirstAndFollowSets.html

I think I didn't learn what is a predictive set, can you walk me through it quickly ?

As you do here : https://github.com/diegoaguilar/grammar.js/blob/master/grammar.js#L9-L21 parsing the string is the first step, then defining all "simple" rules to use in your logic...

For the algorithm I think you start with the right idea, you "just" need to look at some algorithm description and translate it into JS ;)

Also you can use a object literal instead of new Object(null);

Let me know if I didn't answer your question or if you want more on my/your code.

Have a nice day !