1 11 package org.eclipse.jdt.internal.compiler.ast; 12 13 import org.eclipse.jdt.internal.compiler.flow.FlowContext; 14 import org.eclipse.jdt.internal.compiler.flow.FlowInfo; 15 import org.eclipse.jdt.internal.compiler.impl.*; 16 import org.eclipse.jdt.internal.compiler.lookup.*; 17 18 public abstract class Literal extends Expression { 19 20 public Literal(int s, int e) { 21 22 sourceStart = s; 23 sourceEnd = e; 24 } 25 26 public FlowInfo analyseCode( 27 BlockScope currentScope, 28 FlowContext flowContext, 29 FlowInfo flowInfo) { 30 31 return flowInfo; 32 } 33 34 public abstract void computeConstant(); 35 36 public abstract TypeBinding literalType(BlockScope scope); 37 38 public StringBuffer printExpression(int indent, StringBuffer output){ 39 40 return output.append(source()); 41 } 42 43 public TypeBinding resolveType(BlockScope scope) { 44 this.resolvedType = literalType(scope); 46 47 computeConstant(); 49 if (constant == null) { 50 scope.problemReporter().constantOutOfRange(this, this.resolvedType); 51 constant = Constant.NotAConstant; 52 } 53 return this.resolvedType; 54 } 55 56 public abstract char[] source(); 57 } 58 | Popular Tags |