Hi All,
I am using Antlr3.3 C for a grammar which has returns from the semantic action. I found that the return type in the generated parser code is messed up.
See the following simple test grammar and the errors in the generated parser. Actually, you will see this problem with any return type.
Has anyone seen this problem before? And I wonder if t's fixed in a later release since it's so obvious and easy to hit.
Thanks,
Yiqing
/********************************* antlr_test.g *********************************************/
grammar antlr_test;
options
{
language=C;
}
statement
returns [void*]
: RETURN n=NAME { return n; }
;
RETURN : ('R'|'r')('E'|'e')('T'|'t')('U'|'u')('R'|'r')('N'|'n');
NAME : ( 'A'..'Z' | 'a'..'z' | '_' | '$') ( 'A'..'Z' | 'a'..'z' | '_' | '$' | '0'..'9' )*;
/********************************* antlr_testParser.c *********************************************/
static * statement (pantlr_testParser ctx);
static *
statement(pantlr_testParser ctx)
{
* void;