Ben Ratzlaff wrote:
Howdy, just finished generating code for my first try at antlr, and it crashes during parsing (pardon me if this is a known issue, still finding my way around the website/wiki)
I am trying to keep the bug list up to date for the C runtime and we are working on making JIRA have public logins that allow you to 'watch' bugs without allowing the creation of new ones. All such things take time of course and neither Ter nor myself seem to have had a lot of that lately ;-). However, the bug system can be browsed publicly at: http://antlr.org/jira

There I think you will find that I fixed this issue, but if not then I know I do have it listed as something to fix for 3.1.2. If fixed already then you can get the latest C runtime dist by visiting Hudson at: http://www.antlr.org/hudson/job/ANTLR%20C%20Runtime/

You will likely need a latest jar for the ANTLR tool as I think that there are C codegen template changes to go with it. Again, Hudson is your friend:
http://www.antlr.org/hudson/job/ANTLR%20Tool/

It's erroring during parsing, and crashing while printing the error message, Looks like I still have work to do on my grammar =)

There is probably something going on in your grammar that triggers this, but it could be a function of the fact that in the latest version of the runtime I changed from using calloc to malloc and at the same time tokens don't necessary have a strFactory (which is detected by the pointer being NULL). I have fixed some things in this area in the latest runtime, and you may be running across this.
antlr3commontoken.c line 346
token->tokText.text    = token->strFactory->newStr8(token->strFactory, (pANTLR3_UINT8)"<EOF>");

the strFactory pointer is not valid in my case. I have not yet found where strFactory is assigned to. I can get around this by setting up the factory manually:
Yeah - you should not need to do this.

Jim

pANTLR3_INPUT_STREAM            input = ...
pFactoringLexer                             lexer = ...

pANTLR3_STRING_FACTORY        stringFactory = antlr3StringFactoryNew();
lexer->pLexer->rec->state->tokSource->eofToken.strFactory = stringFactory;

pANTLR3_COMMON_TOKEN_STREAM        lexTokens = antlr3CommonTokenStreamSourceNew(...);
pFactoringParser                parser = ...
parser->progStart(parser); // crash here

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



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

Reply via email to