/* lex_ids.c */

#include "picasm.h"

void doidentifier()
{
	SYMBOL *p;
	char lexbuf[BSIZE];
	int ch;
	int b = 0;

	ch = tolower(lexgetchar());

	while(isalnum(ch) || (ch=='_'))
	{		/* ch is alphanumeric */
		lexbuf[b++] = ch;
		ch = tolower(lexgetchar());
		if ( b>= BSIZE)
			error("compiler error"," lexical name ","buffer full","");
	}
	lexbuf[b] = EOS;
	if (ch != EOF)
 		lexungetc(ch);

	p = lookup(lexbuf);

	if (p == (SYMBOL *)0)
		p = insert(lexbuf, ID, VALUE_UNDEF);

	cpsym(&current_symbol, p);
}


/* ... The End ... */
