Yes, the current version of gUnit only accepts a composite grammar, i.e. you can only test lexical rules within a composite grammar. What Jim suggested is a good way for testing your lexer grammar for now. Assuming that you have a lexer grammar L, and another grammar P which imports L and has only one dummy parser rule is created. Then you can test all lexical rules as below.
gUnit P; lexical-rule-name: "input" OK ... By the way, the next release of gUnit will allow you to test a lexer grammar individually with the syntax: gUnit lexer L; Leon On Nov 23, 2009, at 1:48 PM, Jim Idle wrote: > Not sure myself – it might be coded for composite grammars I > suppose. What you could do though is create a small grammar that > imports your lexer and has a dummy parse rule, then test that > grammar. This would be a workaround of course. > > Jim > > From: [email protected] > [mailto:[email protected] > ] On Behalf Of Cameron Ross > Sent: Monday, November 23, 2009 6:06 AM > To: [email protected] > Subject: Re: [antlr-interest] Testing lexer grammars with gunit > > Anyone? > > On Wed, Nov 18, 2009 at 4:03 PM, Cameron Ross <[email protected]> > wrote: > Hi, > > I have a lexer grammar that I'd like to test using gunit. However, > the way I have things configured, gunit assumes a composite > grammar. Is there a way that I can tell gunit that the grammar > being tested is a lexer grammar? > > Thanks, > Cameron. > > > > -- > Cameron Ross > Director of Technology > Kojeware Corporation > 705-929-1492 > > List: http://www.antlr.org/mailman/listinfo/antlr-interest > Unsubscribe: > http://www.antlr.org/mailman/options/antlr-interest/your-email-address -- You received this message because you are subscribed to the Google Groups "il-antlr-interest" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/il-antlr-interest?hl=en.
List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address
