/********************* */
/*! \file bounded_token_factory.h
** \verbatim
** Original author: cconway
** Major contributors: mdeters
** Minor contributors (to current version): none
** This file is part of the CVC4 prototype.
** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys)
** Courant Institute of Mathematical Sciences
** New York University
** See the file COPYING in the top-level source directory for licensing
** information.\endverbatim
**
** \brief An ANTLR3 bounded token factory.
**
** An ANTLR3 bounded token factory. The factory has a fixed number of
** tokens that are re-used as parsing proceeds. Only use this factory
** if you *know* that the number of active tokens will be bounded
** (e.g., if you're using a bounded token stream).
**/
#include "cvc4parser_private.h"
#ifndef __CVC4__PARSER__BOUNDED_TOKEN_FACTORY_H
#define __CVC4__PARSER__BOUNDED_TOKEN_FACTORY_H
namespace CVC4 {
namespace parser {
#ifdef __cplusplus
extern "C" {
#endif
/** Create a token factory with a pool of exactly size
tokens,
* attached to the input stream input
. size
must be
* greater than the maximum lookahead in the parser, or tokens will be prematurely re-used.
*
* We abuse pANTLR3_TOKEN_FACTORY
fields for our own purposes:
* pANTLR3_COMMON_TOKEN *pools
: a pointer to a single-element array, a single pool of tokens
* ANTLR3_INT32 thisPool
: the size of the pool
* ANTLR3_UINT32 nextToken
: the index of the next token to be returned
* */
pANTLR3_TOKEN_FACTORY
BoundedTokenFactoryNew(pANTLR3_INPUT_STREAM input,ANTLR3_UINT32 size);
#ifdef __cplusplus
}/* extern "C" */
#endif
}/* CVC4::parser namespace */
}/* CVC4 namespace */
#endif /* __CVC4__PARSER__BOUNDED_TOKEN_FACTORY_H */