[nodejs] parser generators for node?

247 views
Skip to first unread message

Scott Taylor

unread,
May 14, 2010, 3:25:30 AM5/14/10
to nod...@googlegroups.com

Are there any parser-generators out there for node? I'm pretty sure I ran into a PEG the other day for node.js, but don't see anything like it listed on the modules page:

http://wiki.github.com/ry/node/modules

Scott

--
You received this message because you are subscribed to the Google Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com.
To unsubscribe from this group, send email to nodejs+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nodejs?hl=en.

Benedict Eastaugh

unread,
May 14, 2010, 4:36:20 AM5/14/10
to nod...@googlegroups.com
On 14 May 2010 08:25, Scott Taylor <sc...@railsnewbie.com> wrote:
>
> Are there any parser-generators out there for node?  I'm pretty sure I ran into a PEG the other day for node.js, but don't see anything like it listed on the modules page:

http://github.com/jcoglan/canopy

"Canopy is a parser compiler for JavaScript, based on Parsing
Expression Grammars and heavily influenced by Treetop."

It's not for Node specifically, but it could presumably run on it.

Benedict.

Karl Guertin

unread,
May 14, 2010, 12:04:10 PM5/14/10
to nod...@googlegroups.com
On Fri, May 14, 2010 at 3:25 AM, Scott Taylor <sc...@railsnewbie.com> wrote:
> Are there any parser-generators out there for node?

There have been a couple parser tools released and none are node-specific:

http://github.com/zaach/jison

http://pegjs.majda.cz/

http://inimino.org/~inimino/blog/peg_first_release

http://tinlizzie.org/ometa-js/#JavaScript_Compiler

http://github.com/doublec/jsparse

The first is notable because that's what Jeremy Ashkenas is using for
CoffeeScript which is, to my knowledge, one of the more complex parser
projects in javascript (though it's actually written in coffeescript
since the language is self hosting). The third has a ES5 parser as an
example. The last two are parser combinators. Additionally, jslint has
Douglas Crockford's take on javascript parsing, which differs a bit.

Zachary Carter

unread,
May 14, 2010, 12:15:54 PM5/14/10
to nod...@googlegroups.com
On Fri, May 14, 2010 at 12:04 PM, Karl Guertin <gray...@gr.ayre.st> wrote:
On Fri, May 14, 2010 at 3:25 AM, Scott Taylor <sc...@railsnewbie.com> wrote:
> Are there any parser-generators out there for node?

There have been a couple parser tools released and none are node-specific:

http://github.com/zaach/jison

http://pegjs.majda.cz/

http://inimino.org/~inimino/blog/peg_first_release

http://tinlizzie.org/ometa-js/#JavaScript_Compiler

http://github.com/doublec/jsparse

The first is notable because that's what Jeremy Ashkenas is using for
CoffeeScript which is, to my knowledge, one of the more complex parser
projects in javascript (though it's actually written in coffeescript
since the language is self hosting). The third has a ES5 parser as an
example. The last two are parser combinators. Additionally, jslint has
Douglas Crockford's take on javascript parsing, which differs a bit.


Jison is written in JavaScript. You can try it online here: http://jison.org/try/. It's not node-specific but does use commonjs modules, so it should work fine if placed in your load path.

--
Zach Carter

Scott Taylor

unread,
May 14, 2010, 12:28:18 PM5/14/10
to nod...@googlegroups.com

On May 14, 2010, at 12:04 PM, Karl Guertin wrote:

> On Fri, May 14, 2010 at 3:25 AM, Scott Taylor <sc...@railsnewbie.com> wrote:
>> Are there any parser-generators out there for node?
>
> There have been a couple parser tools released and none are node-specific:
>
> http://github.com/zaach/jison
>
> http://pegjs.majda.cz/
>
> http://inimino.org/~inimino/blog/peg_first_release
>
> http://tinlizzie.org/ometa-js/#JavaScript_Compiler
>
> http://github.com/doublec/jsparse
>
> The first is notable because that's what Jeremy Ashkenas is using for
> CoffeeScript which is, to my knowledge, one of the more complex parser
> projects in javascript (though it's actually written in coffeescript
> since the language is self hosting). The third has a ES5 parser as an
> example. The last two are parser combinators. Additionally, jslint has
> Douglas Crockford's take on javascript parsing, which differs a bit.

Great overview, thanks!

I really think Gazelle (http://www.reverberate.org/gazelle/) is the way of the future when it comes to PG's, but for now I'll probably give jison a shot.

Thanks again.

Scott

Mark S. Miller

unread,
May 14, 2010, 12:45:30 PM5/14/10
to nod...@googlegroups.com, Alessandro Warth, Tom Van Cutsem
[+alexwarth, +tvcutsem]

We've been using OMeta quite happily at <http://es-lab.googlecode.com/svn/trunk/site/esparser/index.html>.
--
    Cheers,
    --MarkM
Reply all
Reply to author
Forward
0 new messages