Picon
Gravatar

[grammarians] status

What is the status of the Ruby Grammar Project? This list is obviously
dead silent, but in reading different things I wonder if work is being
done on other related projects. For example, are people working on
Ripper? What is the status of that? What about ANTLR's Ruby bindings
themselves. ANTLR's wiki page on them makes them sound incomplete, and
the only other thing I can find is some two year old blog posts on
split-s.

--

-- 
Daniel Brumbaugh Keeney
Markus Liedl | 7 Oct 17:24
Picon
Picon

[grammarians] the project 'Ruby top down grammar'

hello list,

My name is Markus Liedl. I'm working on an alternative Ruby grammar.

It is currently only working within Emacs, but I intend to write  a grammar interpreter in Ruby, so one can use
Ruby as a host language instead of Emacs Lisp.

Have a look and tell me what you think about it.

It's hosted on rubyforge, project name ruby-tp-dw-gram; you can check it out via

  svn checkout svn://rubyforge.org/var/svn/ruby-tp-dw-gram

See below for the top of the README file.

thanks,
Markus Liedl

                   Ruby Top Down Grammar

This project tries to implement a reusable top-down grammar of
the Ruby language.

It may be used to
  * bootstrap a pure ruby vm
  * advanced syntax highlighting in emacs

This Ruby grammar can be classified as a non-exhaustively
backtracking, non-deterministic top-down parser.

(Continue reading)

Jason Morrison | 6 Feb 05:13
Picon
Gravatar

[grammarians] Error recovery / parsing partial source

Hey there folks,

I was wondering if anyone could point me in the right direction.  I'm looking into parsing partial/invalid Ruby code, specifically for the intent of type inference for code completion.  (See http://soc.jayunit.net... I've disappeared under school work for a while, but am trying to reach the surface under the guise of a project for my Language Processors/Compiler Construction course ;)  The biggest roadblock I'd hit upon, and would like to revisit, is the fact that,inside an IDE code completion (and therefore type inference) is often requested at a point at which the code is not syntactically valid.  I.e.:

def foo
  if ( cond )
    puts myvar. # invoke completion

class MyKlass
  class << self; def method
#... and so on

So we're in the middle of a method-send on the myvar expr, a puts call, an if statement, and a method definition node, none of which are closed before the MyKlass class declaration node is opened (or, equally often, EOF is hit when we are ten nodes deep).  My knowledge of error hooks inside parsers is spotty at best (and limited to error symbols in yacc-based Jay), so I appeal to you all: is there research on heuristics in this area I can read up on?  Is there such error recovery functionality in C-Ruby's parse.y (I spy some nice yyerror() calls in there, do they bubble up into JRuby's Jay parser?) or Rubyfront's ruby.g (didn't see any, but I don't know ANTLR)?

If not, any thoughts on the idea?  Is this something that can be usefully resolved via error symbols?  (Perhaps I am simply ignorant of an error-recovery enabling flag in my trusty JRuby parsing calls, and would be better served directing inquiry to the JRuby list?)  I'd rather not just blast an arbitrary number of close-parens and "end"s at the cursor position until a valid parse surfaces, the quickest-and-dirtiest solution that originally came to mind ; )

Thanks very much for any input!
Jason

--
Jason Morrison
jason.p.morrison-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
http://jayunit.net
(585) 216-5657

_______________________________________________
Rubygrammar-grammarians mailing list
Rubygrammar-grammarians@...
http://rubyforge.org/mailman/listinfo/rubygrammar-grammarians
Hanan Mneimneh | 2 Dec 18:57
Picon
Favicon

[grammarians] ruby parser

Hello

I need to generate a state machine for a web application developed using 
ruby on rails. For this purpose, I need to dynamically parse the controller 
which is a ruby class. Is there a decent parser to parse ruby code????????

Thanks in advance

_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar - get it now! 
http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/
MenTaLguY | 1 Nov 19:38
Favicon
Gravatar

[grammarians] rubygrammar-commits

Oh, a quick heads' up -- the rubygrammar-commits mailing list should be
working now.

Would anyone object if I also shunted the commit messages here, or do
you think the lists should be separate?

-mental
_______________________________________________
Rubygrammar-grammarians mailing list
Rubygrammar-grammarians@...
http://rubyforge.org/mailman/listinfo/rubygrammar-grammarians
Picon
Gravatar

[grammarians] Test message


--

-- 
Charles Oliver Nutter, JRuby Core Developer
Blogging on Ruby and Java @ headius.blogspot.com
Help spec out Ruby today! @ www.headius.com/rubyspec
headius@... -- charles.nutter@...
Picon
Gravatar

[grammarians] Reply directly to list?

Is anyone opposed to having replies go straight to the mailing list? I 
really hate having one list out of my whole set of subscriptions that 
requires doing "reply all" rather than just "reply".

--

-- 
Charles Oliver Nutter, JRuby Core Developer
Blogging on Ruby and Java @ headius.blogspot.com
Help spec out Ruby today! @ www.headius.com/rubyspec
headius@... -- charles.nutter@...
Nick Sieger | 27 Oct 19:32
Picon
Gravatar

[grammarians] Visualization of Ruby's grammar

Thought you guys might find this interesting.  I took parse.y and generated a dependency graph of it using ANTLRWorks.  (Note that I didn't use Rubyfront's or Sara's ANTLR grammar, that could be something to do next).

http://blog.nicksieger.com/articles/2006/10/27/visualization-of-rubys-grammar

Any keen observations?  Next steps?

Cheers,
/Nick

_______________________________________________
Rubygrammar-grammarians mailing list
Rubygrammar-grammarians@...
http://rubyforge.org/mailman/listinfo/rubygrammar-grammarians
Picon
Gravatar

[grammarians] RubySpec Wiki back on the air

I've got the RubySpec Wiki back up and running at 
www.headius.com/rubyspec. This isn't the final home or the final 
hardware, but it should be stable and fast for now. Let me know if 
anything looks broken, and feel free to start making updates if it all 
looks ok. When the eventual hardware is setup and working I'll xfer over 
the existing data.

--

-- 
Charles Oliver Nutter, JRuby Core Developer
headius@... -- charles.nutter@...
Blogging at headius.blogspot.com
Picon
Gravatar

[grammarians] Making it happen

Mental has added me as a project admin for RubyGrammar. So I'll be 
helping to push this effort along, for all our benefit. I think the 
first order of business would be asking Xue pretty-please to release the 
RubyFront grammar to this project, so we can all proceed from there. 
Once we've got it into the RubyGrammar domain, the next steps are up to 
y'all:

- Continuing work on correctness
- ANTLR v3?
- Decide on a standard AST structure to be built out of this? (for 
example, JRuby's AST is starting to differ from Ruby's, so even if we 
port ParseTree we'll have compatibility issues...so perhaps we 
grammarians can also devise a common AST structure that all impls could 
be confident would work across impls)

Let the games begin!

--

-- 
Charles Oliver Nutter, JRuby Core Developer
headius@... -- charles.nutter@...
Blogging at headius.blogspot.com
MenTaLguY | 25 Oct 00:32
Favicon
Gravatar

Re: [grammarians] Comparison to RubyFront grammar

On Tue, 2006-10-24 at 16:26 -0500, Nick Sieger wrote:
> I for one am still interested.  I was looking at the rubyfront grammar
> this weekend and I don't think it should be too hard to port to ANTLR
> 3.
> 
> Also, what about the idea of a multi-pass parser?  With Ruby's syntax
> so complex, it might help to break down into several stages for
> understandability.

That was Terence's opinion as well, if I remember correctly (Hi Ter!).
I've not had time to look at the RubyFront grammar deeply, but I was a
little surprised that Yong Zhi was apparently able to do heredocs
without multiple passes, actually.

> Also, on the JRuby project, we have a need for a more fault-tolerant
> parser because eventually IDEs will be using it to parse partial
> source files for refactoring and analysis.  Any ideas here? 

Well ... not much.  One bit of advice from my minor experience in
hand-rolling "fuzzy" parsers for reverse-engineered languages: it's
really easy for "fuzzy" parsers to turn into effectively meaningless
piles of heuristics.

You need a strict grammar as a starting point anyway.  At that point,
you can make a "fuzzy" version largely by establishing specific
"fallback points" where things can end up in an "unparsable blob"
terminal, and otherwise keep it as strict as possible.  Some heuristics
(perhaps as a second pass) are okay, but you have to be able to account
for their interactions so that you don't mis-match a valid input.

In the case of an IDE, those same fallback points might be good units of
granularity at which to only re-parse subranges of a changed file --
that way, you can localize the effects of things like edits which result
in mismatched braces.

Terence might have some more useful ideas and/or practical experience
about that sort of thing as well.  HE'S the grammar expert after all. :)

> MenTaL: I don't think you made it to RubyConf did you?  Sorry you
> missed it.

No ... I probably won't go until/unless I would be giving a
presentation, honestly.  Unless I was sure to contribute significantly,
I wouldn't feel right taking up a scarce slot.

-mental

_______________________________________________
Rubygrammar-grammarians mailing list
Rubygrammar-grammarians@...
http://rubyforge.org/mailman/listinfo/rubygrammar-grammarians

Gmane