diff options
author | Christopher L. Conway <christopherleeconway@gmail.com> | 2010-03-30 20:22:33 +0000 |
---|---|---|
committer | Christopher L. Conway <christopherleeconway@gmail.com> | 2010-03-30 20:22:33 +0000 |
commit | 8730e9320a833a9eb0e65074f9988950b7424c0c (patch) | |
tree | 1cb09404256743e208fece079ba473595e05edcd /src/parser/bounded_token_factory.h | |
parent | 8c87c05ac56a5f29b2ae1e658f2d7d3b7b588163 (diff) |
Merging from branches/antlr3 (r246:354)
Diffstat (limited to 'src/parser/bounded_token_factory.h')
-rw-r--r-- | src/parser/bounded_token_factory.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/parser/bounded_token_factory.h b/src/parser/bounded_token_factory.h new file mode 100644 index 000000000..6f8729c19 --- /dev/null +++ b/src/parser/bounded_token_factory.h @@ -0,0 +1,38 @@ +/* + * bounded_token_factory.h + * + * Created on: Mar 2, 2010 + * Author: dejan + */ + +#ifndef BOUNDED_TOKEN_FACTORY_H_ +#define BOUNDED_TOKEN_FACTORY_H_ + +namespace CVC4 { +namespace parser { + +#ifdef __cplusplus +extern "C" { +#endif + +/** Create a token factory with a pool of exactly <code>size</code> tokens, + * attached to the input stream <code>input</code>. <code>size</code> must be + * greater than the maximum lookahead in the parser, or tokens will be prematurely re-used. + * + * We abuse <code>pANTLR3_TOKEN_FACTORY</code> fields for our own purposes: + * <code>pANTLR3_COMMON_TOKEN *pools</code>: a pointer to a single-element array, a single pool of tokens + * <code>ANTLR3_INT32 thisPool</code>: the size of the pool + * <code>ANTLR3_UINT32 nextToken</code>: the index of the next token to be returned + * */ +pANTLR3_TOKEN_FACTORY +BoundedTokenFactoryNew(pANTLR3_INPUT_STREAM input,ANTLR3_UINT32 size); + +#ifdef __cplusplus +} +#endif + +} +} + + +#endif /* BOUNDED_TOKEN_FACTORY_H_ */ |