StringBuffer buf = new StringBuffer(name.toUpperCase());
char c;
// Check for identifier token
if (token.getId() != GrammarConstants.IDENTIFIER) {
throw new ParseException(ParseException.INTERNAL_ERROR,
null,
token.getStartLine(),
token.getStartColumn());
}
// Remove all non-identifier characters
for (int i = 0; i < buf.length(); i++) {
c = buf.charAt(i);
if (('A' <= c && c <= 'Z') || ('0' <= c && c <= '9')) {
// Do nothing
} else {
buf.deleteCharAt(i--);
}
}
// Check for name collitions
if (names.containsKey(buf.toString())) {
throw new ParseException(
ParseException.ANALYSIS_ERROR,
"duplicate identifier '" + name + "' is similar or " +
"equal to previously defined identifier '" +
names.get(buf.toString()) + "'",
token.getStartLine(),