char[] source = identifier.toCharArray();
scanner.setSource(source);
final int length = source.length;
scanner.resetTo(0, length - 1);
try {
int tokenType = scanner.scanIdentifier();
if (tokenType != TerminalTokens.TokenNameIdentifier) {
throw new IllegalArgumentException("Invalid identifier : >" + identifier + "<"); //$NON-NLS-1$//$NON-NLS-2$
}
if (scanner.currentPosition != length) {
// this is the case when there is only one identifier see 87849