Hi,
  Is there a way where in if there is a lexer error,the antlr reports the error 
and exits without creating the parser for it ?
for ex:
In the calling program:
 
lex = LexerNew(input);
{
fprintf(stderr, 
exit(ANTLR3_ERR_NOMEM);
}
tokens = antlr3CommonTokenStreamSourceNew(ANTLR3_SIZE_HINT, TOKENSOURCE(lex));
{
fprintf(stderr, 
exit(ANTLR3_ERR_NOMEM);
} 
//want the lexer to exit here only in case of a lexer error 
-------------------------------------------------------------------------
parser = ParserNew(tokens);
//calling the startrule from my .g file
parser ->starting _rule(parser);
 
Thanksif(lex == NULL)"Unable to create the lexer due to malloc() 
failure1\n"); if(tokens == NULL)"Out of memory trying to allocate token 
stream\n");


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