antlr and c++ exception handling
antlr and c++ exception handling
- Subject: antlr and c++ exception handling
- From: Gerard Iglesias <email@hidden>
- Date: Fri, 25 Jul 2003 01:03:48 +0200
Hello,
A second try about this question :)
I am using ANTLR to build a parser and I have a big problem because in
case of bad token recognition I get a bad exception handling that
terminate the app.
I use gcc3 and doesn't work neither under Xcode/Panther.
this is typically the kind of call stack I get :
(gdb) bt
#0 0x9001a0ac in kill ()
#1 0x9008c8e0 in abort ()
#2 0x00021c84 in __cxxabiv1::__terminate(void (*)()) () at
/usr/include/gcc/darwin/3.3/c++/bits/stl_alloc.h:656
#3 0x00021cc8 in std::terminate() () at
/usr/include/gcc/darwin/3.3/c++/bits/stl_alloc.h:656
#4 0x00023c5c in __cxa_throw () at
/usr/include/gcc/darwin/3.3/c++/bits/stl_alloc.h:656
#5 0x00003328 in CalcLexer::nextToken() (this=0xbffff1c4) at
/usr/include/gcc/darwin/3.3/c++/bits/basic_string.h:355
#6 0x00010820 in antlr::TokenBuffer::fill(int) (this=0x380bd0,
amount=1) at ../antlr/CircularQueue.hpp:65
#7 0x00010a6c in antlr::TokenBuffer::LT(int) (this=0x380bd0, i=1) at
TokenBuffer.cpp:56
#8 0x000670f8 in antlr::LLkParser::LT(int) (this=0x0, i=-1610604616)
at
/Users/gerard/Developer/Tools/antlr-2.7.2/lib/cpp/antlr/
ParserSharedInputState.hpp:62
#9 0x000067f8 in CalcParser::atom() (this=0xbffffa80) at
/Users/gerard/Developer/Tools/antlr-2.7.2/lib/cpp/antlr/
ASTRefCount.hpp:74
#10 0x00005f2c in CalcParser::mexpr() (this=0xbffffa80) at
CalcParser.cpp:75
#11 0x00005690 in CalcParser::expr() (this=0xbffffa80) at
CalcParser.cpp:39
#12 0x000087c4 in main (argc=-1073744576, argv=0xbffffa80) at
Main2.cpp:50
(gdb)
Here I use one of the small given example with antlr2.7.2 ; calc2,
calling it with :
./calc2 ghjggfhgf
I don't understand very well the path at the level 5 :
/usr/include/gcc/darwin/3.3/c++/bits/basic_string.h:355
But I think that it happen with this kind of statement in the lexer
generated code :
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& e) {
throw ANTLR_USE_NAMESPACE(antlr)TokenStreamRecognitionException(e);
}
Any ideas ?
Best regards
Gerard
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.