Exemplo n.º 1
0
  void
initializeLexDispatchTable()
{
	int	c;
	int	lexIdentifier();
	int	lexNumber();
	int	lexLiteral();
	int	lexCharacterConstant();
	int	lexStringConstant();
	int	lexOperator();

	for (c = 0; c < LEX_DISPATCH_TABLE_SIZE; c++) {
		if (isAlphabetic(c) || c=='$')
			lexDispatchTable[c] = lexIdentifier;
		else if (isNumeric(c))
			lexDispatchTable[c] = lexNumber;
		else if (isMacrossLiteralCharacter(c))
			lexDispatchTable[c] = lexLiteral;
		else if (c == '\'')
			lexDispatchTable[c] = lexCharacterConstant;
		else if (c == '"')
			lexDispatchTable[c] = lexStringConstant;
		else
			lexDispatchTable[c] = lexOperator;
	}
}
Exemplo n.º 2
0
/* isAlphaNumeric: determines whether a char is an (upper or lowercase)
alpha char, a numeric char or none of the above. */
int isAlphaNumeric(int c)
{
    return isAlphabetic(c) || isNumeric(c);
}