break;
default :
if ( CharClass.isDigit( comp_c))
{
if ( ! CharClass.isOctalDigit( comp_c))
throw new LexException( "Bad octal number!");
m_token.setType( NumericLiteral.OCTAL);
m_state=OCTAL_DIGITS;
}
else
{
finish();
return m_caller.nextCharacter( c);
}
}
m_buffer.append( comp_c);
break;
case FLOAT_FRACTION :
switch ( comp_c)
{
case 'L' :
case 'F' :
m_buffer.append( comp_c);
m_token.setFlag( comp_c);
finish();
return m_caller;
case 'E' :
m_state=EXPONENT_SIGN;
break;
default :
if ( ! CharClass.isDigit( comp_c))
{
finish();
return m_caller.nextCharacter(c);
}
}
m_buffer.append( comp_c);
break;
case EXPONENT_SIGN :
if ( c=='+' || c=='-' || CharClass.isDigit(c))
{
m_buffer.append( c);
m_state=EXPONENT_DIGITS;
break;
}
else
throw new LexException( "Improperly formatted exponent");
case EXPONENT_DIGITS :
switch ( comp_c)
{
case 'L' :
case 'F' :
m_token.setFlag( comp_c);
m_buffer.append( comp_c);
finish();
return m_caller;
default :
if ( ! CharClass.isDigit( c))
{
finish();
return m_caller.nextCharacter( c);
}
}
m_buffer.append( c);
break;
case HEX_DIGITS :
switch ( comp_c)
{
case 'U' :
case 'L' :
m_token.setFlag( comp_c);
m_state=INT_SUFFIX;
break;
default :
if ( ! CharClass.isHexDigit( comp_c))
{
finish();
return m_caller.nextCharacter( c);
}
}
m_buffer.append( c);
break;
case OCTAL_DIGITS :
switch ( comp_c)
{
case 'U' :
case 'L' :
m_token.setFlag( comp_c);
m_state=INT_SUFFIX;
break;
default :
if ( ! CharClass.isOctalDigit( comp_c))
{
finish();
return m_caller.nextCharacter( c);
}
}
m_buffer.append( c);
break;
case INT_SUFFIX :
if ( comp_c=='U' || comp_c=='L')
{
m_token.setFlag( comp_c);
m_buffer.append( comp_c);
}
else
{
finish();
return m_caller.nextCharacter(c);
}
break;
default :
throw new LexException ( "Bad number parsing state");
}
return this;
}