llvm-gcc-4.2-2.9/gcc/cp/parser.c
/* Create a new lexer whose token stream is primed with the tokens in
   CACHE.  When these tokens are exhausted, no new tokens will be read.  */
Create a new lexer whose token stream is primed with the tokens in
CACHE.  When these tokens are exhausted, no new tokens will be read.
Create a new lexer whose token stream is primed with the tokens in CACHE . When these tokens are exhausted no new tokens will be read .
static cp_lexer *
cp_lexer_new_from_tokens (cp_token_cache *cache)
{
  cp_token *first = cache->first;
  cp_token *last = cache->last;
  cp_lexer *lexer = GGC_CNEW (cp_lexer);
  lexer->buffer = NULL;
  lexer->buffer_length = 0;
  lexer->next_token = first == last ? (cp_token *)&eof_token : first;
  lexer->last_token = last;
  lexer->saved_tokens = VEC_alloc (cp_token_position, heap,
				   CP_SAVED_TOKEN_STACK);
#ifdef ENABLE_CHECKING
  lexer->debugging_p = false;
#endif
  gcc_assert (lexer->next_token->type != CPP_PURGED);
  return lexer;
}
static cp_lexer * cp_lexer_new_from_tokens ( cp_token_cache * cache ) { cp_token * first = cache -> first ; cp_token * last = cache -> last ; cp_lexer * lexer = GGC_CNEW ( cp_lexer ) ; lexer -> buffer = NULL ; lexer -> buffer_length = 0 ; lexer -> next_token = first == last ? ( cp_token * ) & eof_token : first ; lexer -> last_token = last ; lexer -> saved_tokens = VEC_alloc ( cp_token_position , heap , CP_SAVED_TOKEN_STACK ) ; #ifdef ENABLE_CHECKING lexer -> debugging_p = false ; #endif gcc_assert ( lexer -> next_token -> type != CPP_PURGED ) ; return lexer ; }
Create a new lexer whose token stream is primed with the tokens in
CACHE.
Create a new lexer whose token stream is primed with the tokens in CACHE .
/* We do not own the buffer.  */ /* Initially we are not debugging.  */