Hello,

I've found the following bugs in the generated parser (C target):

1. This is the most annoying problem because I cannot solve it any
other way. My tree grammar is:
function:       ^(Function ^(DatabaseObject Nil COUNT) countArgument) ->
^(Function[$COUNT.text] countArgument);

The excerpt from generated code for this is:
pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR,
    (pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, Function,
(pANTLR3_UINT8)(COUNT162->getText(COUNT162))), root_1));

The COUNT162->getText(COUNT162) function returns pANTLR3_STRING which
is casted to pANTLR3_UINT8??? When I manually change the code to:
root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR,
    (pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, Function,
(pANTLR3_UINT8)(COUNT162->getText(COUNT162)->chars)), root_1));

it works as expected.

2. My tree grammar doesn't do a lot. Because of that I wanted to
switch on rewriting (options {rewrite = true;}). But the generated
parser was not able to be compiled. Some variables were not defined,
getParent() function was called on ADAPTOR which doesn't contain
anything similar etc. (when I generated Java parser from that grammar
it was compiled correctly)

3. The wildcard is not working for the C target! I reported that here
already that there was no response. So once more. My tree grammar is
similar to:
func:    ^(FUNC arg=.) -> ^(Function $arg);

When I try to generate a parser a crazy error message appears that a
template rewriteWildcardLabelRef.st cannot be found. (again, for Java
everything works as expected)

Best regards,
Tomas

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
-~----------~----~----~----~------~----~------~--~---

Reply via email to