From yawl.20481481 at bloglines.com Thu Dec 1 12:19:18 2005 From: yawl.20481481 at bloglines.com (yawl.20481481@bloglines.com) Date: 1 Dec 2005 17:19:18 -0000 Subject: [grammarians] ambiguity with method call? Message-ID: <1133457558.90361166.4408.sendItem@bloglines.com> I have solved a similar issue(see http://seclib.blogspot.com/2005/11/more-on-leftshift-and-heredoc.html ) and the same rules apply in this case. For "foo[1]", first the lexer need to lookup symbol table to see if foo is a local varible. If not found, assume foo is a function. After we know foo is function, then space is important. If there is a space between foo and [1]("foo [1]"), then foo is a function call and [1] is the parameter(same as "foo([1])"). If there is no space("foo[1]"), then it is treated as "(foo)[1]". Since the parser can not see space, the burden is on the lexer. In other words, it should return different token type for '[' in different context. For example: LBRACK_IN_COMMAND and LBRACK. Xue Yong Zhi http://seclib.blogspot.com --- Terence Parr I look could easily be seen to > interpret foo[1] in two ways: > > (foo)[1] > > and > > foo([1]) > > even when we know foo is a function call. > how could it not? From mental at rydia.net Thu Dec 1 14:07:28 2005 From: mental at rydia.net (MenTaLguY) Date: Thu, 01 Dec 2005 14:07:28 -0500 Subject: [grammarians] ambiguity with method call? In-Reply-To: <1133457558.90361166.4408.sendItem@bloglines.com> References: <1133457558.90361166.4408.sendItem@bloglines.com> Message-ID: <1133464049.24508.149.camel@localhost.localdomain> On Thu, 2005-12-01 at 17:19 +0000, yawl.20481481 at bloglines.com wrote: > I have solved a similar issue(see http://seclib.blogspot.com/2005/11/more-on-leftshift-and-heredoc.html > ) and the same rules apply in this case. Interesting. In the heredoc case, you've basically got to distinguish between unary and binary uses of <<. Do you have a partial ANTLR grammar together, out of curiosity? I'd be interested to see what you and Ter each have at this point. -mental -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://rubyforge.org/pipermail/rubygrammar-grammarians/attachments/20051201/da1a6efd/attachment.bin From yawl.20481481 at bloglines.com Thu Dec 1 16:38:08 2005 From: yawl.20481481 at bloglines.com (yawl.20481481@bloglines.com) Date: 1 Dec 2005 21:38:08 -0000 Subject: [grammarians] ambiguity with method call? Message-ID: <1133473088.2763476152.25408.sendItem@bloglines.com> --- MenTaLguY Do you have a partial ANTLR grammar together, out of curiosity? > > I'd be interested to see what you and Ter each have at this point. > > -mental > I have a working lexer which passed the test on ruby standard library. The parser is in progress, the busy day job prevents me from doing anything recently. But I do plan to finish it duing the coming holidays. From parrt at cs.usfca.edu Thu Dec 1 16:56:43 2005 From: parrt at cs.usfca.edu (Terence Parr) Date: Thu, 1 Dec 2005 13:56:43 -0800 Subject: [grammarians] ambiguity with method call? In-Reply-To: <1133457558.90361166.4408.sendItem@bloglines.com> References: <1133457558.90361166.4408.sendItem@bloglines.com> Message-ID: <378880AA-A5D6-46FE-AA96-EC3CC19FC066@cs.usfca.edu> On Dec 1, 2005, at 9:19 AM, yawl.20481481 at bloglines.com wrote: > I have solved a similar issue(see http://seclib.blogspot.com/ > 2005/11/more-on-leftshift-and-heredoc.html > ) and the same rules apply in this case. > > After we know foo is function, then space is > important. If there is a space between foo and [1]("foo [1]"), > then foo > is a function call and [1] is the parameter(same as "foo([1])"). If > there > is no space("foo[1]"), then it is treated as "(foo)[1]". Hi. An alternative is to pass all whitespace to the parser on a hidden channel and then ask if there is a space before the [1] in the lexer. :) > Since the parser > can not see space, the burden is on the lexer. In other words, it > should return > different token type for '[' in different context. For example: > LBRACK_IN_COMMAND > and LBRACK. That will work but I'm thinking that passing in white space to the parser is reasonable since it's significant (surprisingly) in Ruby just like python (shudder). ;) Ter From parrt at cs.usfca.edu Thu Dec 1 16:57:49 2005 From: parrt at cs.usfca.edu (Terence Parr) Date: Thu, 1 Dec 2005 13:57:49 -0800 Subject: [grammarians] ambiguity with method call? In-Reply-To: <1133464049.24508.149.camel@localhost.localdomain> References: <1133457558.90361166.4408.sendItem@bloglines.com> <1133464049.24508.149.camel@localhost.localdomain> Message-ID: <50101FDB-C6E2-4AC5-9957-0367C8FB21C5@cs.usfca.edu> On Dec 1, 2005, at 11:07 AM, MenTaLguY wrote: > On Thu, 2005-12-01 at 17:19 +0000, yawl.20481481 at bloglines.com wrote: >> I have solved a similar issue(see http://seclib.blogspot.com/ >> 2005/11/more-on-leftshift-and-heredoc.html >> ) and the same rules apply in this case. > > Interesting. In the heredoc case, you've basically got to distinguish > between unary and binary uses of <<. > > Do you have a partial ANTLR grammar together, out of curiosity? > > I'd be interested to see what you and Ter each have at this point. I have nothing interesting yet, though it does parse some stuff. I've not recovered from seeing the "warts" or ruby yet. I'm also trying to use ANTLR v3, which of course I'm doing to find some bugs. Also i'll need syntactic predicates in v3 for ruby which I don't have yet. Ter From mental at rydia.net Thu Dec 8 10:27:13 2005 From: mental at rydia.net (mental@rydia.net) Date: Thu, 08 Dec 2005 10:27:13 -0500 Subject: [grammarians] do/end vs braces In-Reply-To: References: <200512080909.44873.slitt@earthlink.net> Message-ID: <1134055633.439850d1d1e09@www.rydia.net> Quoting Joe Van Dyk : > 5.times { |i| puts i } > > 5.times do |i| > puts i > end > Generally people save do .. end for multiline stuff. Don't think > there's a difference in speed. I can promise there's no speed difference. They both parse to the same thing: (iter (call (lit #<5>) times) (dasgn_curr i) (fcall puts (array (dvar i)))) (iter (call (lit #<5>) times) (dasgn_curr i) (fcall puts (array (dvar i)))) However, {} and do...end are not totally interchangable as syntax. These are all equivalent: obj.meth( 1, 2 ) { |i| puts i } obj.meth( 1, 2 ) do |i| puts i end obj.meth 1, 2 do |i| puts i end But this will net you a parse error ('2' is not a valid method name): obj.meth 1, 2 { |i| puts i } And these two parse equivalently: obj.meth 1, zog { |i| puts i } obj.meth( 1, zog { |i| puts i } ) Think of {} as being more "clingy" than do...end. Basically, {} has higher precedence than do...end, just as (among otherwise equivalent operators) && has higher precedence than 'and', and || has higher precedence than 'or'. I'm sure Ter hates Ruby now. :) -mental From mental at rydia.net Thu Dec 8 16:44:14 2005 From: mental at rydia.net (mental@rydia.net) Date: Thu, 08 Dec 2005 16:44:14 -0500 Subject: [grammarians] CVS -> SVN Message-ID: <1134078254.4398a92e5bcec@www.rydia.net> We're going to SVN YAY. RubyForge has just brought SVN support online, so I'll be putting in a support request to get us switched over... -mental From bwatt at austin.rr.com Thu Dec 8 16:57:19 2005 From: bwatt at austin.rr.com (Brian Watt) Date: Thu, 08 Dec 2005 15:57:19 -0600 Subject: [grammarians] CVS -> SVN In-Reply-To: <1134078254.4398a92e5bcec@www.rydia.net> References: <1134078254.4398a92e5bcec@www.rydia.net> Message-ID: <4398AC3F.6010004@austin.rr.com> -mental Most Excellent. Bri mental at rydia.net wrote: >We're going to SVN YAY. > >RubyForge has just brought SVN support online, so I'll be putting in >a support request to get us switched over... > >-mental > > >_______________________________________________ >Rubygrammar-grammarians mailing list >Rubygrammar-grammarians at rubyforge.org >http://rubyforge.org/mailman/listinfo/rubygrammar-grammarians > > > > From parrt at cs.usfca.edu Thu Dec 8 17:44:41 2005 From: parrt at cs.usfca.edu (Terence Parr) Date: Thu, 8 Dec 2005 14:44:41 -0800 Subject: [grammarians] do/end vs braces In-Reply-To: <1134055633.439850d1d1e09@www.rydia.net> References: <200512080909.44873.slitt@earthlink.net> <1134055633.439850d1d1e09@www.rydia.net> Message-ID: <68C480DF-504F-40EA-B934-AD81D0B7850C@cs.usfca.edu> On Dec 8, 2005, at 7:27 AM, mental at rydia.net wrote: > But this will net you a parse error ('2' is not a valid method > name): > > obj.meth 1, 2 { |i| > puts i > } Yikes! Not sure what's up there. What does the {...} bind to then? The 2? If so, why is 2 considered a method. > And these two parse equivalently: > > obj.meth 1, zog { |i| > puts i > } > > obj.meth( 1, zog { |i| puts i } ) > > Think of {} as being more "clingy" than do...end. That I can parse mentally. :) > Basically, {} has higher precedence than do...end, just as (among > otherwise equivalent operators) && has higher precedence than > 'and', and || has higher precedence than 'or'. > > I'm sure Ter hates Ruby now. :) Well, I am trying to ignore edge cases while I learn the language ;) Starting with the warts is probably not a good idea ;) Ter From mental at rydia.net Fri Dec 9 01:33:30 2005 From: mental at rydia.net (MenTaLguY) Date: Fri, 09 Dec 2005 01:33:30 -0500 Subject: [grammarians] do/end vs braces In-Reply-To: <68C480DF-504F-40EA-B934-AD81D0B7850C@cs.usfca.edu> References: <200512080909.44873.slitt@earthlink.net> <1134055633.439850d1d1e09@www.rydia.net> <68C480DF-504F-40EA-B934-AD81D0B7850C@cs.usfca.edu> Message-ID: <1134110010.30512.275.camel@localhost.localdomain> On Thu, 2005-12-08 at 14:44 -0800, Terence Parr wrote: > On Dec 8, 2005, at 7:27 AM, mental at rydia.net wrote: > > But this will net you a parse error ('2' is not a valid method > > name): > > > > obj.meth 1, 2 { |i| > > puts i > > } > > Yikes! Not sure what's up there. What does the {...} bind to then? > The 2? If so, why is 2 considered a method. Binds to the 2, yes. But then it fails to match, as 2 isn't a method. It should also fail if there were an lvar rather than a private method call in that position. That's an interesting question actually ... how it matches enough to bind, but not enough to succeed. -mental -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://rubyforge.org/pipermail/rubygrammar-grammarians/attachments/20051209/4a29d051/attachment.bin From mental at rydia.net Fri Dec 9 13:58:42 2005 From: mental at rydia.net (mental@rydia.net) Date: Fri, 09 Dec 2005 13:58:42 -0500 Subject: [grammarians] grammarians say: "SVN please!", Tom says: "Here you go!" Message-ID: <1134154722.4399d3e282235@www.rydia.net> f00p. So now we've got an SCM what doesn't need to hang its head in total shame next to Perforce. svk makes things even better. Those of you working on grammars for Ruby or a subset thereof (any of you, not just Ter and not even just for ANTLR), would you like some space in our repo? I'd love it if we could get everyone publishing their work so we can bounce ideas back and forth and crib from each other. ----- Forwarded message from noreply at rubyforge.org ----- Date: Fri, 9 Dec 2005 13:38:17 GMT From: noreply at rubyforge.org Reply-To: noreply at rubyforge.org Subject: [ support-Support Requests-2979 ] grammarians say: "SVN please!" [rubygrammar] To: noreply at rubyforge.org Support Requests item #2979, was opened at 2005-12-09 06:30 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=102&aid=2979&group_id=5 Category: cvs-to-svn Group: None >Status: Closed Resolution: None Priority: 3 Submitted By: MenTaL guY (mental) Assigned to: Tom Copeland (tom) >Summary: grammarians say: "SVN please!" [rubygrammar] Initial Comment: This is the rubygrammar project, requesting SVN. Thanks Tom and others! You rock! ---------------------------------------------------------------------- >Comment By: Tom Copeland (tom) Date: 2005-12-09 13:38 Message: Hi mental - No problemo, done, enjoy! Yours, Tom ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=102&aid=2979&group_id=5 ----- End forwarded message ----- From mental at rydia.net Mon Dec 12 21:48:15 2005 From: mental at rydia.net (MenTaLguY) Date: Mon, 12 Dec 2005 21:48:15 -0500 Subject: [grammarians] 'nother little bit of fun syntax Message-ID: <1134442096.30512.501.camel@localhost.localdomain> Learned this today. begin ... end while condition Same as C's: do { ... } while condition; Matz wants to deprecate it, but it'll probably be around for the remainder of the 1.8 series anyway. Note that it is distinct from the normal meaning of suffix-while: # prints: foO! begin puts "foO!" end while false # prints nothing puts "foO!" while false -mental -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://rubyforge.org/pipermail/rubygrammar-grammarians/attachments/20051212/ddba29bf/attachment.bin From mental at rydia.net Fri Dec 16 18:27:28 2005 From: mental at rydia.net (mental@rydia.net) Date: Fri, 16 Dec 2005 18:27:28 -0500 Subject: [grammarians] v2 to v3 Message-ID: <1134775648.43a34d60c8dc4@www.rydia.net> Ter, Do you think it'd be reasonable for me to start on a v2 grammar for a convenient subset of Ruby (I think that basically means no heredocs or arbi-quotes), and then we migrate that to v3 to cover the remainder? Additionally, would it possible to do a read-only mirror of the v3 Perforce depot in SVN or CVS somehow? -mental From etienne.durand at mail.com Sat Dec 17 03:05:04 2005 From: etienne.durand at mail.com (Jean-Etienne DURAND) Date: Sat, 17 Dec 2005 03:05:04 -0500 Subject: [grammarians] Parser generator Message-ID: <20051217080504.B68002002A@ws1-1a.us4.outblaze.com> Hi, I am looking for a parser generator like ANTLR, but generating ruby code. Is there any? Thank you, Jean-Etienne From duncanmak at gmail.com Tue Dec 13 20:54:07 2005 From: duncanmak at gmail.com (Duncan Mak) Date: Tue, 13 Dec 2005 20:54:07 -0500 Subject: [grammarians] s-expression dumper: works Message-ID: <97f770b50512131754i7473377en199381ff9afa328b@mail.gmail.com> Hello, I'm trying to use the dump-ruby script, and I'm having trouble running it. I installed ParseTree and RubyInline using Rubygems and when I try to run your script, I see this error message: diphthong:~/src/ruby $ ruby dump-ruby.rb hello.rb /usr/lib/ruby/gems/1.8/gems/RubyInline-3.5.0/./inline.rb:372:in `build': undefined method `+' for nil:NilClass (NoMethodError) from /usr/lib/ruby/gems/1.8/gems/RubyInline-3.5.0/./inline.rb:602:in `inline' from /usr/lib/ruby/gems/1.8/gems/ParseTree-1.4.0 /lib/parse_tree.rb:101 from /usr/lib/ruby/1.8/rubygems/custom_require.rb:21:in `require' from /usr/lib/ruby/1.8/rubygems.rb:182:in `activate' from /usr/lib/ruby/1.8/rubygems.rb:181:in `activate' from /usr/lib/ruby/1.8/rubygems.rb:37:in `require_gem_with_options' from /usr/lib/ruby/1.8/rubygems.rb:31:in `require_gem' from dump-ruby.rb:7 I have ParseTree (1.4.0) and RubyInline (3.5.0) installed. P.S, Have you looked into RubyLexer at all? The README claims that it's more robust than other implementations out there. Duncan. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rubygrammar-grammarians/attachments/20051213/ac1698c4/attachment.htm From mental at rydia.net Sat Dec 17 11:51:13 2005 From: mental at rydia.net (MenTaLguY) Date: Sat, 17 Dec 2005 11:51:13 -0500 Subject: [grammarians] Parser generator In-Reply-To: <20051217080504.B68002002A@ws1-1a.us4.outblaze.com> References: <20051217080504.B68002002A@ws1-1a.us4.outblaze.com> Message-ID: <1134838274.26791.2.camel@localhost.localdomain> On Sat, 2005-12-17 at 03:05 -0500, Jean-Etienne DURAND wrote: > Hi, > > I am looking for a parser generator like ANTLR, but generating ruby code. Is there any? There are other Ruby parser generators, but none quite like ANTLR. However, it's not extremely difficult to write a backend for ANTLR to generate Ruby code; it's just that nobody's done it yet. ANTLR itself is fairly language-neutral. The most similar existing Ruby solution is probably Coco/Ruby: http://www.zenspider.com/ZSS/Products/CocoR/ Ryan rocks. -mental -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://rubyforge.org/pipermail/rubygrammar-grammarians/attachments/20051217/cea7d814/attachment.bin From mental at rydia.net Sat Dec 17 12:15:22 2005 From: mental at rydia.net (MenTaLguY) Date: Sat, 17 Dec 2005 12:15:22 -0500 Subject: [grammarians] s-expression dumper: works In-Reply-To: <97f770b50512131754i7473377en199381ff9afa328b@mail.gmail.com> References: <97f770b50512131754i7473377en199381ff9afa328b@mail.gmail.com> Message-ID: <1134839724.26791.9.camel@localhost.localdomain> On Tue, 2005-12-13 at 20:54 -0500, Duncan Mak wrote: > Hello, > > I'm trying to use the dump-ruby script, and I'm having trouble running > it. > > I installed ParseTree and RubyInline using Rubygems and when I try to > run your script, I see this error message: > > diphthong:~/src/ruby $ ruby dump-ruby.rb hello.rb > /usr/lib/ruby/gems/1.8/gems/RubyInline-3.5.0/./inline.rb:372:in > `build': undefined method `+' for nil:NilClass (NoMethodError) Hmm, I'm using ParseTree 1.3.7 and RubyInline 3.4.0, which may be the difference. As far as I know it's not a problem with the script itself, but rather an incompatibility between the two versions of those libraries you've got. Does the parse_tree_show script which comes with ParseTree work (it does basically the same thing)? > P.S, Have you looked into RubyLexer at all? The README claims that > it's more robust than other implementations out there. RubyLexer is only a lexer, not a full-blown parser. It is, however, probably going to be useful as a reference when writing the ANTLR lexer; thanks! -mental -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://rubyforge.org/pipermail/rubygrammar-grammarians/attachments/20051217/0bf29f00/attachment-0001.bin From mtraverso at gmail.com Sat Dec 17 11:33:37 2005 From: mtraverso at gmail.com (Martin Traverso) Date: Sat, 17 Dec 2005 08:33:37 -0800 Subject: [grammarians] Parser generator In-Reply-To: <20051217080504.B68002002A@ws1-1a.us4.outblaze.com> References: <20051217080504.B68002002A@ws1-1a.us4.outblaze.com> Message-ID: <82b9e79a0512170833t650f4e50xdb92267d26103be4@mail.gmail.com> Indeed! Take a look at http://split-s.blogspot.com/2005/12/antlr-for-ruby.html Give it a try, and let me know if you run into any problems. I'm still working to support some of antlr's features, such as scopes, rule parameters, AST construction, etc, but the basic stuff seems to be working fairly well. Martin On 12/17/05, Jean-Etienne DURAND wrote: > > Hi, > > I am looking for a parser generator like ANTLR, but generating ruby code. > Is there any? > > Thank you, > Jean-Etienne > > _______________________________________________ > Rubygrammar-grammarians mailing list > Rubygrammar-grammarians at rubyforge.org > http://rubyforge.org/mailman/listinfo/rubygrammar-grammarians > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rubygrammar-grammarians/attachments/20051217/1dba8e76/attachment.htm From etienne.durand at mail.com Mon Dec 19 09:19:01 2005 From: etienne.durand at mail.com (Jean-Etienne DURAND) Date: Mon, 19 Dec 2005 09:19:01 -0500 Subject: [grammarians] Parser generator Message-ID: <20051219141901.0DB34837C2@ws1-2a.us4.outblaze.com> As Martin Traverso advice, i had a look at ANTLRV3 and http://split-s.blogspot.com/2005/12/antlr-for-ruby.html Works fine for ascii characters, but I have some difficulties to make it work for unicode characters. Anybody had similiar experiences? Regards, Jean-Etienne ----- Original Message ----- From: MenTaLguY To: "Jean-Etienne DURAND" Subject: Re: [grammarians] Parser generator Date: Sat, 17 Dec 2005 11:51:13 -0500 > > On Sat, 2005-12-17 at 03:05 -0500, Jean-Etienne DURAND wrote: > > Hi, > > > > I am looking for a parser generator like ANTLR, but generating > > ruby code. Is there any? > > There are other Ruby parser generators, but none quite like ANTLR. > > However, it's not extremely difficult to write a backend for ANTLR to > generate Ruby code; it's just that nobody's done it yet. ANTLR itself > is fairly language-neutral. > > The most similar existing Ruby solution is probably Coco/Ruby: > > http://www.zenspider.com/ZSS/Products/CocoR/ > > Ryan rocks. > > -mental << signature.asc >> Jean-Etienne Durand Mail: etienne dot durand at mail dot com Blog: http://spaces.msn.com/members/jetienne From mental at rydia.net Mon Dec 19 15:21:24 2005 From: mental at rydia.net (mental@rydia.net) Date: Mon, 19 Dec 2005 15:21:24 -0500 Subject: [grammarians] shortcut to self.class ? In-Reply-To: <43a706f4$0$117$edfadb0f@dread16.news.tele.dk> References: <43a6b5f5$0$99992$edfadb0f@dread16.news.tele.dk> <8pDpf.91846$65.2657828@twister1.libero.it> <43a706f4$0$117$edfadb0f@dread16.news.tele.dk> Message-ID: <1135023684.43a71644d31dd@www.rydia.net> Quoting Daniel Schierbeck : > >> class.some_method # legal > >> class # illegal, or rather, creates a new class > > > > +1, but I wonder if this may be a limitation of the parser > > Probably. I'm getting a bit fed up with the current parser, it > seems to kill off a lot of good ideas. What's the status on that > new ANTLR grammar? Ter's still learning Ruby and I'm still learning ANTLR. -mental From parrt at cs.usfca.edu Tue Dec 20 16:07:06 2005 From: parrt at cs.usfca.edu (Terence Parr) Date: Tue, 20 Dec 2005 13:07:06 -0800 Subject: [grammarians] shortcut to self.class ? In-Reply-To: <1135023684.43a71644d31dd@www.rydia.net> References: <43a6b5f5$0$99992$edfadb0f@dread16.news.tele.dk> <8pDpf.91846$65.2657828@twister1.libero.it> <43a706f4$0$117$edfadb0f@dread16.news.tele.dk> <1135023684.43a71644d31dd@www.rydia.net> Message-ID: <33DB4EFE-3272-4263-99D3-8C0B2F1457CD@cs.usfca.edu> On Dec 19, 2005, at 12:21 PM, mental at rydia.net wrote: > Quoting Daniel Schierbeck : > >>>> class.some_method # legal >>>> class # illegal, or rather, creates a new class >>> >>> +1, but I wonder if this may be a limitation of the parser >> >> Probably. I'm getting a bit fed up with the current parser, it >> seems to kill off a lot of good ideas. What's the status on that >> new ANTLR grammar? > > Ter's still learning Ruby and I'm still learning ANTLR. Yeah, it may be awhile before I have enough time to learn ruby sufficiently to parse it. It's a very complicated language when you peer into the edge cases. Makes python look simple. :( Ter From mental at rydia.net Tue Dec 20 17:28:39 2005 From: mental at rydia.net (mental@rydia.net) Date: Tue, 20 Dec 2005 17:28:39 -0500 Subject: [grammarians] shortcut to self.class ? In-Reply-To: <33DB4EFE-3272-4263-99D3-8C0B2F1457CD@cs.usfca.edu> References: <43a6b5f5$0$99992$edfadb0f@dread16.news.tele.dk> <8pDpf.91846$65.2657828@twister1.libero.it> <43a706f4$0$117$edfadb0f@dread16.news.tele.dk> <1135023684.43a71644d31dd@www.rydia.net> <33DB4EFE-3272-4263-99D3-8C0B2F1457CD@cs.usfca.edu> Message-ID: <1135117719.43a885974c196@www.rydia.net> Quoting Terence Parr : > Yeah, it may be awhile before I have enough time to learn ruby > sufficiently to parse it. It's a very complicated language when > you peer into the edge cases. Makes python look simple. :( I think what I'm going to do at this point is go ahead and start on that v2 grammar for a Ruby subset, just so we keep our forward momentum. We'll migrate to v3 when that's a little more baked. As far as Ruby goes, I'm definitely going to need your help for the weird stuff (e.g. heredocs), but most of the edge cases are just edge cases and I think I can deal with those. -mental From parrt at cs.usfca.edu Tue Dec 20 17:56:28 2005 From: parrt at cs.usfca.edu (Terence Parr) Date: Tue, 20 Dec 2005 14:56:28 -0800 Subject: [grammarians] v2 to v3 In-Reply-To: <1134775648.43a34d60c8dc4@www.rydia.net> References: <1134775648.43a34d60c8dc4@www.rydia.net> Message-ID: <207FE44F-E232-47E4-BC29-D8C3EB7E4D5B@cs.usfca.edu> On Dec 16, 2005, at 3:27 PM, mental at rydia.net wrote: > Ter, > > Do you think it'd be reasonable for me to start on a v2 grammar for > a convenient subset of Ruby (I think that basically means no > heredocs or arbi-quotes), and then we migrate that to v3 to cover > the remainder? That could make sense. I'm finding it hard to get enough time to learn ruby enough...those edge cases freaked me out too...the "central" grammar probably is not bad at all... > Additionally, would it possible to do a read-only mirror of the v3 > Perforce depot in SVN or CVS somehow? Good question...i wonder if a web mirror would be sufficient? Ter From parrt at cs.usfca.edu Tue Dec 20 19:15:31 2005 From: parrt at cs.usfca.edu (Terence Parr) Date: Tue, 20 Dec 2005 16:15:31 -0800 Subject: [grammarians] shortcut to self.class ? In-Reply-To: <1135117719.43a885974c196@www.rydia.net> References: <43a6b5f5$0$99992$edfadb0f@dread16.news.tele.dk> <8pDpf.91846$65.2657828@twister1.libero.it> <43a706f4$0$117$edfadb0f@dread16.news.tele.dk> <1135023684.43a71644d31dd@www.rydia.net> <33DB4EFE-3272-4263-99D3-8C0B2F1457CD@cs.usfca.edu> <1135117719.43a885974c196@www.rydia.net> Message-ID: <78C93F26-5F09-48DC-AABA-CAA0E9439876@cs.usfca.edu> On Dec 20, 2005, at 2:28 PM, mental at rydia.net wrote: > Quoting Terence Parr : > >> Yeah, it may be awhile before I have enough time to learn ruby >> sufficiently to parse it. It's a very complicated language when >> you peer into the edge cases. Makes python look simple. :( > > I think what I'm going to do at this point is go ahead and start on > that v2 grammar for a Ruby subset, just so we keep our forward > momentum. We'll migrate to v3 when that's a little more baked. Kewl. > As far as Ruby goes, I'm definitely going to need your help for the > weird stuff (e.g. heredocs), but most of the edge cases are just > edge cases and I think I can deal with those. No worries. I think that we should consider a stream object that processes all random delimiters into a standard one and then the lexer has it easy. :) Ter From mental at rydia.net Tue Dec 20 19:30:57 2005 From: mental at rydia.net (MenTaLguY) Date: Tue, 20 Dec 2005 19:30:57 -0500 Subject: [grammarians] v2 to v3 In-Reply-To: <207FE44F-E232-47E4-BC29-D8C3EB7E4D5B@cs.usfca.edu> References: <1134775648.43a34d60c8dc4@www.rydia.net> <207FE44F-E232-47E4-BC29-D8C3EB7E4D5B@cs.usfca.edu> Message-ID: <1135125058.26791.22.camel@localhost.localdomain> On Tue, 2005-12-20 at 14:56 -0800, Terence Parr wrote: > > Additionally, would it possible to do a read-only mirror of the v3 > > Perforce depot in SVN or CVS somehow? > > Good question...i wonder if a web mirror would be sufficient? Not for SVN or CVS, but you could do a git repository that way, if you've got an export tool for perforce -> git. (I'm actually a big fan of git, but I realize I'm probably in the minority yet...) -mental -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://rubyforge.org/pipermail/rubygrammar-grammarians/attachments/20051220/8613d483/attachment.bin From parrt at cs.usfca.edu Wed Dec 21 14:24:58 2005 From: parrt at cs.usfca.edu (Terence Parr) Date: Wed, 21 Dec 2005 11:24:58 -0800 Subject: [grammarians] v2 to v3 In-Reply-To: <1135125058.26791.22.camel@localhost.localdomain> References: <1134775648.43a34d60c8dc4@www.rydia.net> <207FE44F-E232-47E4-BC29-D8C3EB7E4D5B@cs.usfca.edu> <1135125058.26791.22.camel@localhost.localdomain> Message-ID: On Dec 20, 2005, at 4:30 PM, MenTaLguY wrote: > On Tue, 2005-12-20 at 14:56 -0800, Terence Parr wrote: >>> Additionally, would it possible to do a read-only mirror of the v3 >>> Perforce depot in SVN or CVS somehow? >> >> Good question...i wonder if a web mirror would be sufficient? > > Not for SVN or CVS, but you could do a git repository that way, if > you've got an export tool for perforce -> git. > > (I'm actually a big fan of git, but I realize I'm probably in the > minority yet...) If you're using v2 for now, we could probably just hold off, right? Or is this for another reason? Thanks, Ter From puellula at gmail.com Fri Dec 23 03:51:08 2005 From: puellula at gmail.com (Sara) Date: Fri, 23 Dec 2005 09:51:08 +0100 Subject: [grammarians] Ruby Grammar Message-ID: <006e01c6079e$05eeef90$6501a8c0@trudy> HI :) I send my Ruby Grammar where I'm working! I have realized a Parser for ruby. This Grammar interest a little part of Ruby Grammar. Bye Bye Sara -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rubygrammar-grammarians/attachments/20051223/9dd8b6d9/attachment-0001.htm -------------- next part -------------- A non-text attachment was scrubbed... Name: RubyGrammar.g Type: application/octet-stream Size: 5912 bytes Desc: not available Url : http://rubyforge.org/pipermail/rubygrammar-grammarians/attachments/20051223/9dd8b6d9/RubyGrammar-0001.obj From puellula at gmail.com Fri Dec 23 07:45:35 2005 From: puellula at gmail.com (Sara) Date: Fri, 23 Dec 2005 13:45:35 +0100 Subject: [grammarians] Ruby Grammar Message-ID: <00ac01c607be$c64bb9b0$6501a8c0@trudy> HI :) I send my Ruby Grammar where I'm working! I have realized a Parser for ruby. This Grammar interest a little part of Ruby Grammar. Bye Bye Sara -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rubygrammar-grammarians/attachments/20051223/de541119/attachment.htm -------------- next part -------------- A non-text attachment was scrubbed... Name: RubyGrammar.g Type: application/octet-stream Size: 5912 bytes Desc: not available Url : http://rubyforge.org/pipermail/rubygrammar-grammarians/attachments/20051223/de541119/RubyGrammar.obj From mental at rydia.net Fri Dec 23 14:10:00 2005 From: mental at rydia.net (MenTaLguY) Date: Fri, 23 Dec 2005 14:10:00 -0500 Subject: [grammarians] Ruby Grammar In-Reply-To: <006e01c6079e$05eeef90$6501a8c0@trudy> References: <006e01c6079e$05eeef90$6501a8c0@trudy> Message-ID: <1135365001.26791.127.camel@localhost.localdomain> On Fri, 2005-12-23 at 09:51 +0100, Sara wrote: > HI :) > I send my Ruby Grammar where I'm working! I have realized a Parser for > ruby. > This Grammar interest a little part of Ruby Grammar. Oh, hey, cool! What license is this available under? -mental -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://rubyforge.org/pipermail/rubygrammar-grammarians/attachments/20051223/da743ca7/attachment.bin From puellula at gmail.com Fri Dec 23 14:40:13 2005 From: puellula at gmail.com (Sara) Date: Fri, 23 Dec 2005 20:40:13 +0100 Subject: [grammarians] Ruby Grammar References: <006e01c6079e$05eeef90$6501a8c0@trudy> <1135365001.26791.127.camel@localhost.localdomain> Message-ID: <002801c607f8$b3012b80$6501a8c0@trudy> p.s. now I have insert in my file GPL Licence. You can use it ;) Bye Sara :) ----- Original Message ----- From: "Sara" To: "MenTaLguY" Sent: Friday, December 23, 2005 8:31 PM Subject: Re: [grammarians] Ruby Grammar > There is GPL's licence on my Ruby Grammar! > > bye > > Sara > > > ----- Original Message ----- > From: "MenTaLguY" > To: "Sara" > Cc: ; > Sent: Friday, December 23, 2005 8:10 PM > Subject: Re: [grammarians] Ruby Grammar > > -------------- next part -------------- A non-text attachment was scrubbed... Name: RubyGrammar.g Type: application/octet-stream Size: 7385 bytes Desc: not available Url : http://rubyforge.org/pipermail/rubygrammar-grammarians/attachments/20051223/974368b5/RubyGrammar.obj From ryand-ruby at zenspider.com Fri Dec 23 16:51:36 2005 From: ryand-ruby at zenspider.com (Ryan Davis) Date: Fri, 23 Dec 2005 13:51:36 -0800 Subject: [grammarians] Ruby Grammar In-Reply-To: <002801c607f8$b3012b80$6501a8c0@trudy> References: <006e01c6079e$05eeef90$6501a8c0@trudy> <1135365001.26791.127.camel@localhost.localdomain> <002801c607f8$b3012b80$6501a8c0@trudy> Message-ID: On Dec 23, 2005, at 11:40 AM, Sara wrote: > p.s. now I have insert in my file GPL Licence. You can use it ;) *sigh* Why did you go GPL? It would have been much better if you'd gone with the ruby license so we COULD use it. With the GPL attached, I'm not only not using it, I'm not _reading_ it. From parrt at cs.usfca.edu Fri Dec 23 17:31:44 2005 From: parrt at cs.usfca.edu (Terence Parr) Date: Fri, 23 Dec 2005 14:31:44 -0800 Subject: [grammarians] Ruby Grammar In-Reply-To: References: <006e01c6079e$05eeef90$6501a8c0@trudy> <1135365001.26791.127.camel@localhost.localdomain> <002801c607f8$b3012b80$6501a8c0@trudy> Message-ID: <387F587B-EDCA-4E8F-B633-B7AC555B2ACA@cs.usfca.edu> On Dec 23, 2005, at 1:51 PM, Ryan Davis wrote: > > On Dec 23, 2005, at 11:40 AM, Sara wrote: > >> p.s. now I have insert in my file GPL Licence. You can use it ;) > > *sigh* > > Why did you go GPL? Hi Sara...yeah, I think BSD is also a good one. If Ruby has one, then go with that license. :) Ter From mental at rydia.net Fri Dec 23 19:19:32 2005 From: mental at rydia.net (MenTaLguY) Date: Fri, 23 Dec 2005 19:19:32 -0500 Subject: [grammarians] Ruby Grammar In-Reply-To: <387F587B-EDCA-4E8F-B633-B7AC555B2ACA@cs.usfca.edu> References: <006e01c6079e$05eeef90$6501a8c0@trudy> <1135365001.26791.127.camel@localhost.localdomain> <002801c607f8$b3012b80$6501a8c0@trudy> <387F587B-EDCA-4E8F-B633-B7AC555B2ACA@cs.usfca.edu> Message-ID: <1135383572.26791.129.camel@localhost.localdomain> On Fri, 2005-12-23 at 14:31 -0800, Terence Parr wrote: > On Dec 23, 2005, at 1:51 PM, Ryan Davis wrote: > > > > > On Dec 23, 2005, at 11:40 AM, Sara wrote: > > > >> p.s. now I have insert in my file GPL Licence. You can use it ;) > > > > *sigh* > > > > Why did you go GPL? > > Hi Sara...yeah, I think BSD is also a good one. If Ruby has one, > then go with that license. :) Seconded -- the Ruby license would be best for our purposes. -mental -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://rubyforge.org/pipermail/rubygrammar-grammarians/attachments/20051223/a99cd4b7/attachment-0001.bin From mental at rydia.net Fri Dec 23 19:46:01 2005 From: mental at rydia.net (MenTaLguY) Date: Fri, 23 Dec 2005 19:46:01 -0500 Subject: [grammarians] ruby grammar unit testing Message-ID: <1135385161.26791.151.camel@localhost.localdomain> I've finished the first round of work on a unit testing framework for our grammar(s). I took the guts of the dump-ruby.rb script and turned it into generate.rb, which parses and dumps s-expressions for ruby files in the samples/ directory into exemplars/ruby-{RUBY_MAJOR_VERSION}.{RUBY_MINOR_VERSION}. Depending on whether or not a sample parsed or failed, the script will generate either an .sexp file (Lisp s-expressions, with the original Ruby at the top as comments), or a .failed file which is simply a copy of the original sample. Right now the exemplar trees are more or less direct from Ryan's ParseTree library, but I'm going to start "normalizing" them, stripping out the bits which reflect implementation details of the interpreter rather than syntax of the language. Eventually we'll be left with exemplar trees which represent "platonic" Ruby parsing product. The idea is this: those of us doing grammars can set up test harnesses which output .sexp and .failed files, run them against the samples, and compare the output against the contents of the appropriate exemplar directory. -mental -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://rubyforge.org/pipermail/rubygrammar-grammarians/attachments/20051223/d37ed5ec/attachment.bin From mental at rydia.net Fri Dec 23 20:57:01 2005 From: mental at rydia.net (MenTaLguY) Date: Fri, 23 Dec 2005 20:57:01 -0500 Subject: [grammarians] ruby grammar unit testing In-Reply-To: <1135385161.26791.151.camel@localhost.localdomain> References: <1135385161.26791.151.camel@localhost.localdomain> Message-ID: <1135389421.26791.153.camel@localhost.localdomain> Ah, crap. Forgot to mention where to get this. Here, on RubyForge SVN: svn://rubyforge.org/var/svn/rubygrammar/grammar-test/trunk -mental -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://rubyforge.org/pipermail/rubygrammar-grammarians/attachments/20051223/1f83f551/attachment.bin From puellula at gmail.com Sat Dec 24 05:57:09 2005 From: puellula at gmail.com (Sara) Date: Sat, 24 Dec 2005 11:57:09 +0100 Subject: [grammarians] Ruby Grammar References: <006e01c6079e$05eeef90$6501a8c0@trudy><1135365001.26791.127.camel@localhost.localdomain><002801c607f8$b3012b80$6501a8c0@trudy><387F587B-EDCA-4E8F-B633-B7AC555B2ACA@cs.usfca.edu> <1135383572.26791.129.camel@localhost.localdomain> Message-ID: <008d01c60878$cbc9b710$6501a8c0@trudy> OK :) pardon me. I had used GPL Licence because in my other programs I had used this. I didn't knew Ruby Licence. But now I have insert Ruby Licence in my Grammar File. It's ok now? :) Thank you to have told me this! Merry Christmas! Sara -------------- next part -------------- A non-text attachment was scrubbed... Name: RubyGrammar.g Type: application/octet-stream Size: 8537 bytes Desc: not available Url : http://rubyforge.org/pipermail/rubygrammar-grammarians/attachments/20051224/648d00c1/RubyGrammar.obj From mental at rydia.net Sun Dec 25 14:11:34 2005 From: mental at rydia.net (MenTaLguY) Date: Sun, 25 Dec 2005 14:11:34 -0500 Subject: [grammarians] Ruby Grammar In-Reply-To: <008d01c60878$cbc9b710$6501a8c0@trudy> References: <006e01c6079e$05eeef90$6501a8c0@trudy> <1135365001.26791.127.camel@localhost.localdomain> <002801c607f8$b3012b80$6501a8c0@trudy> <387F587B-EDCA-4E8F-B633-B7AC555B2ACA@cs.usfca.edu> <1135383572.26791.129.camel@localhost.localdomain> <008d01c60878$cbc9b710$6501a8c0@trudy> Message-ID: <1135537894.3183.9.camel@localhost.localdomain> On Sat, 2005-12-24 at 11:57 +0100, Sara wrote: > But now I have insert Ruby Licence in my Grammar File. It's ok now? :) That should be fine, though there are less verbose ways to do it (and you forgot your own copyright statement). Is it okay if I change the header to this before comitting? /* * Copyright 2005 Sara * * This grammar is made available under the same license as Ruby. */ -mental -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://rubyforge.org/pipermail/rubygrammar-grammarians/attachments/20051225/31735c36/attachment.bin From puellula at gmail.com Sun Dec 25 18:41:01 2005 From: puellula at gmail.com (Sara) Date: Mon, 26 Dec 2005 00:41:01 +0100 Subject: [grammarians] Ruby Grammar References: <006e01c6079e$05eeef90$6501a8c0@trudy> <1135365001.26791.127.camel@localhost.localdomain> <002801c607f8$b3012b80$6501a8c0@trudy> <387F587B-EDCA-4E8F-B633-B7AC555B2ACA@cs.usfca.edu> <1135383572.26791.129.camel@localhost.localdomain> <008d01c60878$cbc9b710$6501a8c0@trudy> <1135537894.3183.9.camel@localhost.localdomain> Message-ID: <010001c609ac$ac16ad30$6501a8c0@trudy> ok.... it's good :) bye, Sara ----- Original Message ----- From: "MenTaLguY" To: "Sara" Cc: Sent: Sunday, December 25, 2005 8:11 PM Subject: Re: [grammarians] Ruby Grammar From mtraverso at gmail.com Mon Dec 26 15:54:48 2005 From: mtraverso at gmail.com (Martin Traverso) Date: Mon, 26 Dec 2005 12:54:48 -0800 Subject: [grammarians] Ruby grammar for v3 Message-ID: <82b9e79a0512261254r5982007csb597e3774685855d@mail.gmail.com> Hi all! Here's my first attempt at putting together a grammar for Ruby. It is still fairly incomplete, but I thought it'd be more beneficial to let it loose and have other people hacking on it, too. It requires ANTLR v3. Things that still needs to be done: - method calls - case statements - heredocs - %q and double quoted strings - build AST - fix the existing indeterminisms - lots of other stuff I have missed I'm making it available under the Ruby license. Regards, Martin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rubygrammar-grammarians/attachments/20051226/9594907e/attachment-0001.htm -------------- next part -------------- A non-text attachment was scrubbed... Name: ruby.g Type: application/octet-stream Size: 5442 bytes Desc: not available Url : http://rubyforge.org/pipermail/rubygrammar-grammarians/attachments/20051226/9594907e/ruby-0001.obj From mtraverso at gmail.com Mon Dec 26 18:58:46 2005 From: mtraverso at gmail.com (Martin Traverso) Date: Mon, 26 Dec 2005 15:58:46 -0800 Subject: [grammarians] Ruby grammar for v3 In-Reply-To: <82b9e79a0512261254r5982007csb597e3774685855d@mail.gmail.com> References: <82b9e79a0512261254r5982007csb597e3774685855d@mail.gmail.com> Message-ID: <82b9e79a0512261558u7c9b441ct3e5f3afd68ca995f@mail.gmail.com> Just added support for 'case' statements and self-assignment operators. Martin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rubygrammar-grammarians/attachments/20051226/a21e338c/attachment.htm -------------- next part -------------- A non-text attachment was scrubbed... Name: ruby.g Type: application/octet-stream Size: 5838 bytes Desc: not available Url : http://rubyforge.org/pipermail/rubygrammar-grammarians/attachments/20051226/a21e338c/ruby.obj From parrt at cs.usfca.edu Mon Dec 26 18:59:04 2005 From: parrt at cs.usfca.edu (Terence Parr) Date: Mon, 26 Dec 2005 15:59:04 -0800 Subject: [grammarians] Ruby grammar for v3 In-Reply-To: <82b9e79a0512261558u7c9b441ct3e5f3afd68ca995f@mail.gmail.com> References: <82b9e79a0512261254r5982007csb597e3774685855d@mail.gmail.com> <82b9e79a0512261558u7c9b441ct3e5f3afd68ca995f@mail.gmail.com> Message-ID: On Dec 26, 2005, at 3:58 PM, Martin Traverso wrote: > Just added support for 'case' statements and self-assignment > operators. Great! How is v3 working out for you vis-a-vis the grammar? Are you editing with ANTLRWorks? http://www.antlr.org/works. I find that it's not quite ready for building output etc... but it's really nice for understanding / editing a grammar. Ter From mental at rydia.net Mon Dec 26 19:42:26 2005 From: mental at rydia.net (MenTaLguY) Date: Mon, 26 Dec 2005 19:42:26 -0500 Subject: [grammarians] Ruby grammar for v3 In-Reply-To: <82b9e79a0512261558u7c9b441ct3e5f3afd68ca995f@mail.gmail.com> References: <82b9e79a0512261254r5982007csb597e3774685855d@mail.gmail.com> <82b9e79a0512261558u7c9b441ct3e5f3afd68ca995f@mail.gmail.com> Message-ID: <1135644146.3183.12.camel@localhost.localdomain> On Mon, 2005-12-26 at 15:58 -0800, Martin Traverso wrote: > Just added support for 'case' statements and self-assignment > operators. Oh, hey, this is awesome. I'll put it in SVN too. -mental -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://rubyforge.org/pipermail/rubygrammar-grammarians/attachments/20051226/68067ad6/attachment.bin From mental at rydia.net Mon Dec 26 19:43:00 2005 From: mental at rydia.net (MenTaLguY) Date: Mon, 26 Dec 2005 19:43:00 -0500 Subject: [grammarians] Ruby grammar for v3 In-Reply-To: <82b9e79a0512261558u7c9b441ct3e5f3afd68ca995f@mail.gmail.com> References: <82b9e79a0512261254r5982007csb597e3774685855d@mail.gmail.com> <82b9e79a0512261558u7c9b441ct3e5f3afd68ca995f@mail.gmail.com> Message-ID: <1135644180.3183.14.camel@localhost.localdomain> On Mon, 2005-12-26 at 15:58 -0800, Martin Traverso wrote: > Just added support for 'case' statements and self-assignment > operators. Incidentally, do you have a rubyforge account? Would you be interested in SVN access? (same goes for Sara) -mental -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://rubyforge.org/pipermail/rubygrammar-grammarians/attachments/20051226/6a1c3daa/attachment.bin From mental at rydia.net Mon Dec 26 19:47:28 2005 From: mental at rydia.net (MenTaLguY) Date: Mon, 26 Dec 2005 19:47:28 -0500 Subject: [grammarians] grammars in SVN Message-ID: <1135644448.3183.17.camel@localhost.localdomain> Sara's v2 grammar: svn://rubyforge.org/var/svn/rubygrammar/grammars/antlr-v2/trunk Martin's v3 grammar: svn://rubyforge.org/var/svn/rubygrammar/grammars/antlr-v3/trunk -mental -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://rubyforge.org/pipermail/rubygrammar-grammarians/attachments/20051226/e407e914/attachment.bin From mtraverso at gmail.com Tue Dec 27 01:14:05 2005 From: mtraverso at gmail.com (Martin Traverso) Date: Mon, 26 Dec 2005 22:14:05 -0800 Subject: [grammarians] Ruby grammar for v3 In-Reply-To: References: <82b9e79a0512261254r5982007csb597e3774685855d@mail.gmail.com> <82b9e79a0512261558u7c9b441ct3e5f3afd68ca995f@mail.gmail.com> Message-ID: <82b9e79a0512262214x4e5cdc86p8812122b105ccace@mail.gmail.com> On 12/26/05, Terence Parr wrote: > > Great! How is v3 working out for you vis-a-vis the grammar? So far, so good. Although I must say I haven't tried anything too fancy yet. I did find a bug in ea7 with syntactic predicates, but it seems to have been fixed in the current repository version. One thing I would like to see is better messages from the tool in the case of ambiguities. The "Decision can match input such as ... using multiple alternatives: 1, 2" are not too helpful when dealing with complex rules. Are you > editing with ANTLRWorks? http://www.antlr.org/works. I find that > it's not quite ready for building output etc... but it's really nice > for understanding / editing a grammar. Not really, simply because I haven't had a chance to check it out. I'll give it a try. Martin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rubygrammar-grammarians/attachments/20051226/0bf6180f/attachment.htm From puellula at gmail.com Tue Dec 27 05:11:17 2005 From: puellula at gmail.com (Sara) Date: Tue, 27 Dec 2005 11:11:17 +0100 Subject: [grammarians] Ruby grammar for v3 References: <82b9e79a0512261254r5982007csb597e3774685855d@mail.gmail.com><82b9e79a0512261558u7c9b441ct3e5f3afd68ca995f@mail.gmail.com> <1135644180.3183.14.camel@localhost.localdomain> Message-ID: <019c01c60acd$e9608c70$6501a8c0@trudy> Yes, I have rubyforge accont Thank you! Sara ----- Original Message ----- From: "MenTaLguY" To: "Martin Traverso" Cc: Sent: Tuesday, December 27, 2005 1:43 AM Subject: Re: [grammarians] Ruby grammar for v3 > _______________________________________________ > Rubygrammar-grammarians mailing list > Rubygrammar-grammarians at rubyforge.org > http://rubyforge.org/mailman/listinfo/rubygrammar-grammarians > From parrt at cs.usfca.edu Tue Dec 27 13:08:55 2005 From: parrt at cs.usfca.edu (Terence Parr) Date: Tue, 27 Dec 2005 10:08:55 -0800 Subject: [grammarians] Ruby grammar for v3 In-Reply-To: <82b9e79a0512262214x4e5cdc86p8812122b105ccace@mail.gmail.com> References: <82b9e79a0512261254r5982007csb597e3774685855d@mail.gmail.com> <82b9e79a0512261558u7c9b441ct3e5f3afd68ca995f@mail.gmail.com> <82b9e79a0512262214x4e5cdc86p8812122b105ccace@mail.gmail.com> Message-ID: <01C950EB-3898-4360-8205-431A77B4B442@cs.usfca.edu> On Dec 26, 2005, at 10:14 PM, Martin Traverso wrote: > > On 12/26/05, Terence Parr wrote: Great! How > is v3 working out for you vis-a-vis the grammar? > > So far, so good. Although I must say I haven't tried anything too > fancy yet. I did find a bug in ea7 with syntactic predicates, but > it seems to have been fixed in the current repository version. Cool. > One thing I would like to see is better messages from the tool in > the case of ambiguities. The "Decision can match input such as ... > using multiple alternatives: 1, 2" are not too helpful when dealing > with complex rules. Actually I think they are *way* better. At least now you get actual sequence info and are not dumped with all possible tokens at depth i. Further, using ANTLRWorks it will show the paths that are nondeterministic visually in a syntax diagram :) Ter