[antlr-interest] [Help] Question about CTarget of ANTLR

Yang, Y. Y.Yang at tue.nl
Mon Oct 20 06:49:15 PDT 2008


Dear All

When I try to compiler the tree parser example in example-V3 c
directory, I encountered the following problem in Visual Stuido.

>d:\antlr\examples-v3\examples-v3\c\treeparser\langparser.h(83) : error
C2061: syntax error : identifier 'tree'
1>d\antlr\examples-v3\examples-v3\c\treeparser\langparser.h(85) : error
C2059: syntax error : '}'
1>d:\antlr\examples-v3\examples-v3\c\treeparser\langparser.h(94) : error
C2061: syntax error : identifier 'tree'
1>d:\antlr\examples-v3\examples-v3\c\treeparser\langparser.h(96) : error
C2059: syntax error : '}'
1>d:\antlr\examples-v3\examples-v3\c\treeparser\langparser.h(105) :
error C2061: syntax error : identifier 'tree'
1>d:\antlr\examples-v3\examples-v3\c\treeparser\langparser.h(107) :
error C2059: syntax error : '}'
1>d:\antlr\examples-v3\examples-v3\c\treeparser\langparser.h(123) :
error C2061: syntax error : identifier 'LangParser_start_return'
1>d:\antlr\examples-v3\examples-v3\c\treeparser\langparser.h(124) :
error C2143: syntax error : missing ')' before '*'

And I browse the langparser.h and found 

typedef struct LangParser_start_return_struct
{
    /** Generic return elements for ANTLR3 rules that are not in tree
parsers or returning trees
     */
    pANTLR3_COMMON_TOKEN    start;
    pANTLR3_COMMON_TOKEN    stop;
    	tree;
   
}
    LangParser_start_return;


It seems the tree missing the type, however it is generated by ANTLR. Is
it a bug or I missing sth,

Best regards

Yang


More information about the antlr-interest mailing list