}
poolRemove( &expr::NodeValue::s_null );
+
+ if(Debug.isOn("gc:leaks")) {
+ Debug("gc:leaks") << "still in pool:" << std::endl;
+ for(NodeValuePool::const_iterator i = d_nodeValuePool.begin(),
+ iend = d_nodeValuePool.end();
+ i != iend;
+ ++i) {
+ Debug("gc:leaks") << " " << *i
+ << " id=" << (*i)->d_id
+ << " rc=" << (*i)->d_rc
+ << " " << **i << std::endl;
+ }
+ Debug("gc:leaks") << ":end:" << std::endl;
+ }
}
void NodeManager::reclaimZombies() {
d_lexer(NULL),
d_parser(NULL),
d_antlr3InputStream( inputStream.getAntlr3InputStream() ),
- d_tokenStream(NULL) {
+ d_tokenBuffer(NULL) {
}
/*
*/
AntlrInput::~AntlrInput() {
- d_tokenStream->free(d_tokenStream);
+ BoundedTokenBufferFree(d_tokenBuffer);
}
pANTLR3_COMMON_TOKEN_STREAM AntlrInput::getTokenStream() {
- return d_tokenStream;
+ return d_tokenBuffer->commonTstream;
}
void AntlrInput::lexerError(pANTLR3_BASE_RECOGNIZER recognizer) {
throw ParserException("Couldn't create token buffer.");
}
- d_tokenStream = buffer->commonTstream;
+ d_tokenBuffer = buffer;
// Override default lexer error reporting
d_lexer->rec->reportError = &lexerError;
#include <string>
#include <vector>
-#include "input.h"
-#include "parser_options.h"
-#include "parser_exception.h"
+#include "parser/input.h"
+#include "parser/parser_options.h"
+#include "parser/parser_exception.h"
+#include "parser/bounded_token_buffer.h"
#include "expr/expr.h"
#include "expr/expr_manager.h"
#include "util/Assert.h"
/** The ANTLR3 input stream associated with this input. */
pANTLR3_INPUT_STREAM d_antlr3InputStream;
- /** The ANTLR3 token stream associated with this input. We only need this so we can free it on exit.
+ /** The ANTLR3 bounded token buffer associated with this input.
+ * We only need this so we can free it on exit.
* This is set by <code>setLexer</code>.
* NOTE: We assume that we <em>can</em> free it on exit. No sharing! */
- pANTLR3_COMMON_TOKEN_STREAM d_tokenStream;
+ pBOUNDED_TOKEN_BUFFER d_tokenBuffer;
/** Turns an ANTLR3 exception into a message for the user and calls <code>parseError</code>. */
static void reportError(pANTLR3_BASE_RECOGNIZER recognizer);