[antlr-interest] announcing gUnit: ANTLR grammar unit testing
向秦贤
fyaoxy at gmail.com
Sat Aug 18 01:45:21 PDT 2007
Hi,
I change gUnit.g heading grammar as follows:
gUnitDef: 'gunit' g1=target
{interpreter.grammarName = $g1.text;}
(
'walks' g2=target
{interpreter.grammarName = $g2.text;}
)? ';'
header? suite+ ;
target : ID EXT*; //TODO: make a choid between lexer and parser.
and in my target grammar:
grammar On;
@header{package xy.object.notation;}
@lexer::header{package xy.object.notation;}
and my grammar gUnit testsuite:
gunit xy.object.notation.On;
It works fine.
But there is question I not sure, that is just that TODO:
target : ID EXT*; //TODO: make a choid between lexer and parser.
I not sure which way is the best.
2007/8/18, Leon Su <leonsu at msn.com>:
>
> Hi,
>
> Thanks for your trying and the suggestions.
> I'll consider your points for improving the tool :)
>
> Leon
>
> ------------------------------
> Date: Fri, 17 Aug 2007 07:01:57 +0800
> From: fyaoxy at gmail.com
> To: antlr-interest at antlr.org
> Subject: Re: [antlr-interest] announcing gUnit: ANTLR grammar unit testing
>
> Wawo, so great! gunit so pretty!
> I tried, all passed. it make me happy.
>
> gunit On;
>
> words:
> "h" OK
> "hello" OK
> "hello " OK
> "hello world" OK
> "hello world " OK
> "hello world " OK
> " hello world " OK
> "hello " -> "hello"
> "hello world" -> "hello world"
> "hello world " -> "hello world"
> " hello world " -> "hello world"
>
> name:
> "hello,world" OK
> "hello,world" ->"(NAME (TSTRING hello) (TSTRING world))"
> " hello , world " ->"(NAME (TSTRING hello) (TSTRING world))"
>
> <<" hello
> world ">> -><<(NAME (TSTRING hello
> world ))>>
>
> though my last test infinite loop:)
>
> And I have idea:
> I use package name in my grammar, current gunit just take grammar name. so
> do a hard code in it, I would like to deep into this tool.
> I wanna enhance testcase with additional message, like I do before:
> /*string test*/
> //valid single test
> a
> 1
> \n
> word
> 张三
> //invalid single test
> ,
> "
>
> {
> }
> :
> //valid multiple test
> a aaaa
> 123 abc
> 123 abc
> //quoted test
> "abc1"
>
> seems "input ouput" triple can be done "message input output" or "input
> output message"
> even:
> group message{
> test
> test
> }
>
> Thank you again:)
>
>
> 2007/8/16, Terence Parr <parrt at cs.usfca.edu>:
>
> Howdy. Martin Bravenboer gave me a look at his nice grammar testing
> facilities for a GLR-based parser generator (ASF+SDF) at OOPSLA last
> year. He inspired me to build one for ANTLR. Fortunately, I found a
> very capable graduate student, Leon Su, that was able to implement it
> this summer. Here is the wiki with code attached. :)
>
> http://www.antlr.org/wiki/display/ANTLR3/gUnit+-+Grammar+Unit+Testing
>
> Please direct feedback to the group and/or Leon so we can improve
> it. I think you'll find it is a very nice tool. Has both
> interpreted and gUnit->jUnit code gen modes. :)
>
> Terence
>
>
>
>
> --
> 致敬
> 向秦贤
>
>
--
致敬
向秦贤
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20070818/b39f666b/attachment-0001.html
More information about the antlr-interest
mailing list