kschiess / parslet

A small PEG based parser library. See the Hacking page in the Wiki as well.
kschiess.github.com/parslet
MIT License
809 stars 95 forks source link

Java file parser example #90

Closed parttimenerd closed 10 years ago

parttimenerd commented 11 years ago

Here's example of parsing the over all structure of a Java file with parslet. Maybe it's suited for the examples section.

kschiess commented 11 years ago

The examples section should demonstrate parslet features rather than provide our users with prefab parsers. Also - all the examples output is run as part of our rspec suite to verify we don't introduce regressions. I don't think your example is well suited for either of these goals.

Maybe this should go into the projects section in the contribute page? (http://kschiess.github.io/parslet/contribute.html)

rubydesign commented 10 years ago

I think that Projects page sounds just right. I would also like to be on there too (link below), to demonstrate Parslet, but also someone maybe interested.

Like Johannes (parttimenerd), if you have spare energy to learn parsing (like you seem to), you are most welcome to spend it trying to improve my "ruby" parser https://github.com/ruby-in-ruby/crystal (I have quite good tests, so you can't break it too bad without noticing:-)

PPPS: I just executed fibonacci, ie ruby syntax fibo -> parsed, compiled to binary and working . 100% ruby.

muescha commented 10 years ago

I would not expect that examples are under contributing doc. I would prefer a new subpage with examples / and links to projects

rubydesign commented 10 years ago

well, that is a valid point

The contribute header is somewhat misleading if one is looking for projects

kschiess commented 10 years ago

I would welcome a redesign, but can't do it myself. I you want to contribute, why don't you drop me a message?

rubydesign commented 10 years ago

I have been doing a few gh-pages with jekyll now, so i could transform the site to use jekyll so it's easier to change/add things. (but keep the look) And then lift out the projects from the contribute page into it's own new page.

kschiess commented 10 years ago

I would like to keep middleman for now.

rubydesign commented 10 years ago

Sorry about the ignorance, but what is middleman.

On the other hand you may misunderstand jekyll. It does give two nice benefits:

It doesn't force you into anything, so the resulting html would be the same. I can't see the problem there.

But it does allow more dynamic content later, ie adding a news section is a breeze.

rubydesign commented 10 years ago

Ok, found it. A little strangely in the main repository. btw it had taken me all of 10 minutes to convert to jekyll and since you use textile anyway, it should not be difficult to convert the whole thing (not the html as i did). Still, you said middleman so here it is:

https://github.com/dancinglightning/parslet.git

That adds the project page (removed from contribute), a link on documentation, and adds the java and crystal links.

Didn't do the magic script as i figured you'd want to check/correct. If you want a "proper" pull request do say.

T.

kschiess commented 10 years ago

https://github.com/dancinglightning/parslet.git

That adds the project page (removed from contribute), a link on documentation, and adds the java and crystal links.

Didn't do the magic script as i figured you'd want to check/correct. If you want a "proper" pull request do say.

Thanks! All merged and online!

kaspar

rubydesign commented 10 years ago

just noticed this is still open, shouldn't it be closed ?