ECMAScript/JavaScript grammar?

123 views
Skip to first unread message

Tony

unread,
Jun 3, 2009, 8:02:03 PM6/3/09
to treet...@googlegroups.com
Hello everyone,

I'm wondering if someone has already written a Treetop grammar for JavaScript.  Has anyone?

Looking through the web site one of the first things I was trying to find was a collection of Treetop grammars for existing languages, and was somewhat disappointed not to find any.

I saw the examples directory in the github repo contained "lambda_calculus" and that was it.

I think it'd be really handy to have a central collection of grammars that others have already implemented for various languages.

--
Tony Arcieri
medioh.com

Martin Gamsjaeger

unread,
Jun 3, 2009, 10:54:54 PM6/3/09
to treet...@googlegroups.com
Tony,

+1 on that, and i would prefer http://github.com

I know that http://snippets.dzone.com/ is supposed to host some
treetop grammars, but i never find an easy way to browse them all,
also, there is really *no* benefit compared to github.

A github repo, maybe called treetop-grammars or something, would be
really helpful, but would need some sort of gatekeeper. A different
(or additional) approach, would be to establish a naming convention
for the grammars, something like

treetop-mygrammar_name

maybe, so that it's easily searchable on github. Datamapper or Merb
for example go this way with their plugins. There's no need for a
central gatekeeper and it's still easy to find/fork treetop grammars.
The naming convention should be spoken out loud though, so that almost
everyone will see a reference to it.

cheers
snusnu

Scott Taylor

unread,
Jun 4, 2009, 12:17:35 AM6/4/09
to treet...@googlegroups.com
Martin Gamsjaeger wrote:
> Tony,
>
> +1 on that, and i would prefer http://github.com
>

+1 on github.

I just sent Chris a feature request to have it (as well as Lex & Yacc)
put on the search page:

http://github.com/search

Will report back if this gets implemented.

Scott

Clifford Heath

unread,
Jun 10, 2009, 3:31:15 AM6/10/09
to treet...@googlegroups.com
On 04/06/2009, at 10:02 AM, Tony wrote:
> I'm wondering if someone has already written a Treetop grammar for
> JavaScript. Has anyone?

I thought I saw one posted a while back, but can't find the reference
now.
A friend was working on one but was new to Treetop and had bugs to iron
out - I've tried contacting him on Twitter as @whatupdave

Otherwise I have his (still-not-working) version I can probably share,
it might
be a good start.

Clifford Heath.

Clifford Heath

unread,
Jun 12, 2009, 3:56:07 AM6/12/09
to treet...@googlegroups.com
On 10/06/2009, at 5:31 PM, Clifford Heath wrote:
> A friend was working on one but was new to Treetop and had bugs to
> iron
> out - I've tried contacting him on Twitter as @whatupdave

Dave just posted his grammar (still not working correctly) on github,
at <http://github.com/snappycode/jpower/tree/master>

If someone is of a mind to fork and fix, I'm sure it'll benefit others
as well.

Clifford Heath.

Bjørn Arild Mæland

unread,
Jun 13, 2009, 1:20:39 PM6/13/09
to Treetop Development
Instead of a separate gate-keeped repos, I took the liberty to create
a page in the Wiki at GitHub: http://wiki.github.com/nathansobo/treetop/treetop-grammars-in-the-wild

The list is not very comprehensive at the moment, I just took the most
obvious ones from the search result page for "treetop" on GitHub.

-Bjørn
Reply all
Reply to author
Forward
0 new messages