PDA

View Full Version : javascript shift-reduce parser



ivanvodisek
July 16th, 2013, 02:05 PM
Here is an universal parser in javascript: http://synth.wink.ws/moonyparser/


I've been to hell and back to make it faster, but that's it, shift-reduce can't be much faster. Unfortunately, finding errors in text makes it three times slower. At least it has linear parsing time.

ivanvodisek
July 17th, 2013, 12:29 PM
i've just fixed some ugly bug about unspecified tokens. sorry for inconvenience.

oh, did i mention that the code is free for any use? just don't sue me, that's all :)

MG&TL
July 17th, 2013, 04:07 PM
That's pretty cool! Having dabbled with parsers and peered uneasily at the shift-reduce variety, I applaud the effort, especially in JavaScript*. :)


*​Nothing against JS. I just can't see it being easy to write a parser in.

Ivan_Vodiek
November 18th, 2013, 02:11 PM
Hi all.
A new version of Moony Parser is out. This time it implements "Earley" parser. Also handles all CFGs. It is up to 100 times faster than previous version in some cases. There should be less bugs because the code is simpler.
synth.wink.ws/moonyparser/ (http://synth.wink.ws/moonyparser/)