[antlr-interest] ANTLR 3.1.1 test failures

Hartmuth Gutsche hgutsche at storm.ca
Thu Oct 2 19:49:53 PDT 2008


I just looked at the generated T.g file and that one looks like this:

grammar T;
options {output=AST;}
s : x+=a x+=b {System.out.println($x);} ;a : 'a';
b : 'b';
WS : (' '|'
') {skip();};


Which means that the problem shows up in the generated test grammar file.
Does the actual test generation have a problem?

Hartmuth


----- Original Message ----- 
From: "Hartmuth Gutsche" <hgutsche at storm.ca>
To: "Terence Parr" <parrt at cs.usfca.edu>
Cc: <antlr-interest at antlr.org>
Sent: Thursday, October 02, 2008 10:38 PM
Subject: Re: [antlr-interest] ANTLR 3.1.1 test failures


Definitely such a kind of problem. One of the cases I am looking at is the
following:

...
public void testRuleLabelOnTwoDifferentRulesAST() throws Exception {
String grammar =
"grammar T;\n"+
"options {output=AST;}\n"+
"s : x+=a x+=b {System.out.println($x);} ;" +
"a : 'a';\n"+
"b : 'b';\n"+
"WS : (' '|'\n') {skip();};\n";
...

and what I find generated for mWS() in the lexer TLexer.java is:
...
switch (alt1) {
case 1 :
// C:\\DOCUME~1\\HARTMU~1\\LOCALS~1\\Temp\\antlr-1222999104471\\T.g:5:7: ' '
{
match(' ');
}
break;
case 2 :
// C:\\DOCUME~1\\HARTMU~1\\LOCALS~1\\Temp\\antlr-1222999104471\\T.g:5:11:
'\r\n'
{
match("               <<<<<<<-------
");                       <<<<<<<-------

}
break;
...


The "broken call" to match is of course what javac complains about with all
its consequences.
Any idea how to make that "unhappen"?
I still think is has something to-do with my environment setup I just don't
know what to look for.
Which environmental settings could possibly affect the generated code in the
above way?

Hartmuth


----- Original Message ----- 
From: "Terence Parr" <parrt at cs.usfca.edu>
To: "Hartmuth Gutsche" <hgutsche at storm.ca>
Cc: <antlr-interest at antlr.org>
Sent: Thursday, October 02, 2008 2:44 PM
Subject: Re: [antlr-interest] ANTLR 3.1.1 test failures



On Oct 2, 2008, at 11:02 AM, Hartmuth Gutsche wrote:

> I am trying to run the tests under “org.antlr.test” and get 503
> failures
> out of 1095 tests. Are they supposed to pass without failure?
>
> I see this in two different Windows environments.

Mostly likely \n and \r issue.

T



List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org/mailman/options/antlr-interest/your-email-address




More information about the antlr-interest mailing list