From puellula at gmail.com Sun Jan 1 07:05:33 2006 From: puellula at gmail.com (Sara) Date: Sun, 1 Jan 2006 13:05:33 +0100 Subject: [grammarians] Happy New Year Message-ID: <001401c60ecb$ac8bc970$6401a8c0@trudy> happy new year! puellula -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rubygrammar-grammarians/attachments/20060101/51e48718/attachment-0001.htm From mental at rydia.net Sun Jan 22 08:11:06 2006 From: mental at rydia.net (MenTaLguY) Date: Sun, 22 Jan 2006 08:11:06 -0500 Subject: [grammarians] progress? Message-ID: <1137935467.16551.18.camel@localhost.localdomain> Hey there grammarians, I've been pretty heavily distracted as of late, but I'd like to get back to the grammar test suite soon. How are those grammars doing? -mental From puellula at gmail.com Sun Jan 22 08:54:17 2006 From: puellula at gmail.com (Sara) Date: Sun, 22 Jan 2006 14:54:17 +0100 Subject: [grammarians] progress? References: <1137935467.16551.18.camel@localhost.localdomain> Message-ID: <008e01c61f5b$5810aa50$6401a8c0@trudy> HI! My Grammar is in development! :) I have any problem with ANTLR thing... I don't know how I can declare Global Variable because if I write in my grammar: program: {String s = new String();}... I see this only in "program" in the P.java file. I don't know if you understand me! [pardon my English!] Now I'm realizing this: I give to my Java program this (for example) Ruby code: class A def initialize @a = 0 end end My result will be this in memory: new Programma( new ClassDef(new ClassName("A"), new ClassName("Object"), new ClassBody( new MethodDef(new MethodName("initialize"), new Parameter[]{}, new Body(new Assign(new FieldName("a"), new Int(0))) ) ) ) ) I'm stop for some problems for how I can create this. I'm in a good point, but for the moment I have some problems :( Thank you, bye bye puellula ----- Original Message ----- From: "MenTaLguY" To: "Grammarians" Sent: Sunday, January 22, 2006 2:11 PM Subject: [grammarians] progress? > Hey there grammarians, > > I've been pretty heavily distracted as of late, but I'd like to get back > to the grammar test suite soon. How are those grammars doing? > > -mental > > _______________________________________________ > Rubygrammar-grammarians mailing list > Rubygrammar-grammarians at rubyforge.org > http://rubyforge.org/mailman/listinfo/rubygrammar-grammarians From mental at rydia.net Sun Jan 22 11:22:27 2006 From: mental at rydia.net (MenTaLguY) Date: Sun, 22 Jan 2006 11:22:27 -0500 Subject: [grammarians] progress? In-Reply-To: <008e01c61f5b$5810aa50$6401a8c0@trudy> References: <1137935467.16551.18.camel@localhost.localdomain> <008e01c61f5b$5810aa50$6401a8c0@trudy> Message-ID: <1137946948.16551.32.camel@localhost.localdomain> On Sun, 2006-01-22 at 14:54 +0100, Sara wrote: > I'm stop for some problems for how I can create this. I'm in a good point, > but for the moment I have some problems :( Unfortunately, I'm not very skilled with ANTLR yet. I suspect you don't need a global variable -- at most just a member variable in the parser instead -- but I don't know the best way to approach it. Maybe you could ask on the antlr-interest list: http://www.antlr.org:8080/mailman/listinfo/antlr-interest -mental From mtraverso at gmail.com Mon Jan 23 15:37:01 2006 From: mtraverso at gmail.com (Martin Traverso) Date: Mon, 23 Jan 2006 12:37:01 -0800 Subject: [grammarians] progress? In-Reply-To: <1137935467.16551.18.camel@localhost.localdomain> References: <1137935467.16551.18.camel@localhost.localdomain> Message-ID: <82b9e79a0601231237x610bfc9dh144f5703112b0385@mail.gmail.com> Hey! I made a lot of progress a few days back, but then got distracted by work :) I still have a long way to go, but the grammar can now parse most of the higher-level constructs (control flow statements, class/method/module defs, expressions, etc). It even builds ASTs. The remaining changes fall roughly in these areas: - heredocs - dynamic strings and symbols - parsing %q, %Q, %w strings and arrays - assignments (they sort of work, but are not fully fleshed out yet) - support un-parenthesized method calls - regexps Martin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rubygrammar-grammarians/attachments/20060123/f11b333e/attachment.htm From mental at rydia.net Mon Jan 23 17:13:18 2006 From: mental at rydia.net (mental@rydia.net) Date: Mon, 23 Jan 2006 17:13:18 -0500 Subject: [grammarians] Line breaking in Ruby can be dangerous In-Reply-To: References: <2a1c4dc20601230439i68921e6apef4fb1d9877da37@mail.gmail.com> Message-ID: <1138054398.43d554fe80ae1@www.rydia.net> Quoting Christian Neukirchen : > That's because you can have multiple statements in (), e.g.: > > (puts "foo" > puts "bar") > > #=> foo > #=> bar Whoa. -mental From mental at rydia.net Mon Jan 23 17:44:36 2006 From: mental at rydia.net (mental@rydia.net) Date: Mon, 23 Jan 2006 17:44:36 -0500 Subject: [grammarians] progress? In-Reply-To: <82b9e79a0601231237x610bfc9dh144f5703112b0385@mail.gmail.com> References: <1137935467.16551.18.camel@localhost.localdomain> <82b9e79a0601231237x610bfc9dh144f5703112b0385@mail.gmail.com> Message-ID: <1138056276.43d55c54be1af@www.rydia.net> Quoting Martin Traverso : > Hey! > > I made a lot of progress a few days back, but then got distracted > by work :) > > I still have a long way to go, but the grammar can now parse most > of the higher-level constructs (control flow statements, > class/method/module defs, expressions, etc). It even builds ASTs. Great! Nice work, fellow! Keep it up! -mental From mtraverso at gmail.com Mon Jan 23 17:45:21 2006 From: mtraverso at gmail.com (Martin Traverso) Date: Mon, 23 Jan 2006 14:45:21 -0800 Subject: [grammarians] Line breaking in Ruby can be dangerous In-Reply-To: <1138054398.43d554fe80ae1@www.rydia.net> References: <2a1c4dc20601230439i68921e6apef4fb1d9877da37@mail.gmail.com> <1138054398.43d554fe80ae1@www.rydia.net> Message-ID: <82b9e79a0601231445w7ac65a23k824e327e7cb3392@mail.gmail.com> > > > That's because you can have multiple statements in (), e.g.: > > > > (puts "foo" > > puts "bar") > > > I thought my grammar would handle that case, but I somehow missed it. Anyway, I just checked in a fix for it. It was just a matter of changing: '(' conditional_statement ')' to '(' compound_statement ')' :) Martin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rubygrammar-grammarians/attachments/20060123/7a965a5e/attachment.htm From suk at pobox.com Mon Jan 30 23:50:35 2006 From: suk at pobox.com (Peter Suk) Date: Mon, 30 Jan 2006 22:50:35 -0600 Subject: [grammarians] I have a LALR definition that compiles with 0 conflicts Message-ID: Howdy folks, I have an LALR(1) grammar and lexer definition derived by machine translation of the middle section of Matz's parse.y that compiles with 0 conflicts. However, I suspect that many of these conflicts are masked by the compiler-compiler's overlapping tokens facility. In fact, I have just tried an experiment where I "un-overlapped" tLPAREN and tLPAREN_ARG (As well as '(' which is implicitly treated as a token.) This resulted in 5 distinct shift-reduce conflicts and 27 reduce-reduce conflicts. What progress have the grammarians made? --Peter -- There's neither heaven nor hell, save what we grant ourselves. There's neither fairness nor justice, save what we grant each other. From suk at pobox.com Tue Jan 31 10:09:12 2006 From: suk at pobox.com (Peter Suk) Date: Tue, 31 Jan 2006 09:09:12 -0600 Subject: [grammarians] GLR Parser In-Reply-To: References: Message-ID: <8ab88cb017afedb47bebb74293225e74@pobox.com> Has anyone toyed around with the idea of creating a GLR parser based on parse.y? -- There's neither heaven nor hell, save what we grant ourselves. There's neither fairness nor justice, save what we grant each other. From yawl.20481481 at bloglines.com Tue Jan 31 11:27:37 2006 From: yawl.20481481 at bloglines.com (yawl.20481481@bloglines.com) Date: 31 Jan 2006 16:27:37 -0000 Subject: [grammarians] I have a LALR definition that compiles with 0 conflicts Message-ID: <1138724857.53296683.19826.sendItem@bloglines.com> > I have an LALR(1) grammar and lexer definition derived by machine > translation of the middle section of Matz's parse.y that compiles with > 0 conflicts. However, I suspect that many of these conflicts are > masked by the compiler-compiler's overlapping tokens facility. You mean you extracted BNF from parser.y? Then how do you deal with the lexer, still use the c code? > In fact, I have just tried an experiment where I "un-overlapped" > tLPAREN and tLPAREN_ARG (As well as '(' which is implicitly treated as > a token.) This resulted in 5 distinct shift-reduce conflicts and 27 > reduce-reduce conflicts. tLPAREN_ARG and tLPAREN have to be differented to parse the following code: puts (1) + (2) > What progress have the grammarians made? > I am using smoke test to measure my progress. When parsing 1500+ .rb files from ruby's standard libary, I have 48 failures yesterday. Xue Yong Zhi http://seclib.blogspot.com From parrt at cs.usfca.edu Tue Jan 31 14:39:27 2006 From: parrt at cs.usfca.edu (Terence Parr) Date: Tue, 31 Jan 2006 11:39:27 -0800 Subject: [grammarians] GLR Parser In-Reply-To: <8ab88cb017afedb47bebb74293225e74@pobox.com> References: <8ab88cb017afedb47bebb74293225e74@pobox.com> Message-ID: <596F60BB-048C-455F-9AE5-B2F38B96C263@cs.usfca.edu> On Jan 31, 2006, at 7:09 AM, Peter Suk wrote: > Has anyone toyed around with the idea of creating a GLR parser > based on > parse.y? GLR would be easier to use for building the grammar as it naturally deals with ambiguity (which is usually an error, but a "feature" of ruby). THen actions could disambiguate the trees returned from the parser. That said, it's a black-box, which is why people like ANTLR; you can see what it generates and debug it. ;) Ter From mental at rydia.net Tue Jan 31 20:49:06 2006 From: mental at rydia.net (MenTaLguY) Date: Tue, 31 Jan 2006 20:49:06 -0500 Subject: [grammarians] I have a LALR definition that compiles with 0 conflicts In-Reply-To: References: Message-ID: <1138758546.16551.106.camel@localhost.localdomain> On Mon, 2006-01-30 at 22:50 -0600, Peter Suk wrote: > What progress have the grammarians made? We've got a number of different folks working on grammars; I haven't really been keeping close track. I think the person furthest along right now is Martin Traverso, who's got most of the language down except for (as of his last post), multiple assignment, regexps, and some of the more esoteric quoting constructs (e.g. heredocs). His grammar is available here: http://www.rubyforge.org/var/svn/rubygrammar/grammars/antlr-v3/trunk though I don't know how up-to-date the copy there is. -mental