<s> package org . eclipse . jdt . internal . compiler . ast ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . impl . * ; import org . eclipse . jdt . internal . compiler . codegen . * ; import org . eclipse . jdt . internal . compiler . lookup . * ; import org . eclipse . jdt . internal . compiler . parser . ScannerHelper ; public class CharLiteral extends NumberLiteral { char value ; public CharLiteral ( char [ ] token , int s , int e ) { super ( token , s , e ) ; computeValue ( ) ; } public void computeConstant ( ) { this . constant = CharConstant . fromValue ( this . value ) ; } private void computeValue ( ) { if ( ( this . value = this . source [ 1 ] ) != '\\' ) return ; char digit ; switch ( digit = this . source [ 2 ] ) { case 'b' : this . value = '\b' ; break ; case 't' : this . value = '\t' ; break ; case 'n' : this . value = '\n' ; break ; case 'f' : this . value = '\f' ; break ; case 'r' : this . value = '\r' ; break ; case '\"' : this . value = '\"' ; break ; case '\'' : this . value = '\'' ; break ; case '\\' : this . value = '\\' ; break ; default : int number = ScannerHelper . getNumericValue ( digit ) ; if ( ( digit = this . source [ 3 ] ) != '\'' ) number = ( number * 8 ) + ScannerHelper . getNumericValue ( digit ) ; else { this . constant = CharConstant . fromValue ( this . value = ( char ) number ) ; break ; } if ( ( digit = this . source [ 4 ] ) != '\'' ) number = ( number * 8 ) + ScannerHelper . getNumericValue ( digit ) ; this . value = ( char ) number ; break ; } } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { int pc = codeStream . position ; if ( valueRequired ) { codeStream . generateConstant ( this . constant , this . implicitConversion ) ; } codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; } public TypeBinding literalType ( BlockScope scope ) { return TypeBinding . CHAR ; } public void traverse ( ASTVisitor visitor , BlockScope blockScope ) { visitor . visit ( this , blockScope ) ; visitor . endVisit ( this , blockScope ) ; } } </s>