if (context.lookupField(context.getClassContext().getCClass(), ident) != null) { return createClassField(getTokenReference(), ident).analyse(context); }   JExpression outer = context.getBlockContext().lookupOuterLocalVariable(getTokenReference(), ident); if (outer != null) { return outer.analyse(context); }   if (context.getClassContext().lookupOuterField(context.getClassContext().getCClass(), ident) != null) { return createClassField(getTokenReference(), ident).analyse(context); }  try {  CClassType	type = CClassType.lookup(ident);  type.checkType(context); return new JTypeNameExpression(getTokenReference(), type); } catch (UnpositionedError cue) {  throw new CLineError(getTokenReference(), KjcMessages.VAR_UNKNOWN, ident); } }  assert(prefix != null);  try { prefix = prefix.analyse(context); } catch (CLineError cue) { if (cue.hasDescription(KjcMessages.VAR_UNKNOWN)) { return convertToPackageName(cue, context); } else { throw cue; } }   if (prefix instanceof JTypeNameExpression) { if (((JTypeNameExpression)prefix).getClassType().getCClass().lookupField(context.getClassContext().getCClass(), ident) != null) {  return createClassField(getTokenReference(), prefix, ident).analyse(context); } else {  return new JTypeNameExpression(getTokenReference(), ((JTypeNameExpression)prefix).getQualifiedName() + "/" + ident); } }    if (ident == Constants.JAV_LENGTH) {  if (prefix.getType().isArrayType()) { return new JArrayLengthExpression(getTokenReference(), prefix); } }  return createClassField(getTokenReference(), prefix, ident).analyse(context); } catch (UnpositionedError e) { throw e.addPosition(getTokenReference());
  public JExpression analyse(CExpressionContext context) throws PositionedError {    try {      // 6.5.2 Reclassification of Contextually Ambiguous Names      // If the AmbiguousName is a simple name, consisting of a single Identifier:      if (prefix == null) {	// If the Identifier appears within the scope of a local variable declaration or parameter	JLocalVariable	var = context.lookupLocalVariable(ident);	if (var != null) {	  return new JLocalVariableExpression(getTokenReference(), var).analyse(context);	}	// Otherwise, consider the class or interface C within whose declaration the Identifier occurs	if (context.lookupField(context.getClassContext().getCClass(), ident) != null) {	  return createClassField(getTokenReference(), ident).analyse(context);	}	// If the Identifier appears within (an outer) scope of a local variable declaration or parameter	JExpression outer = context.getBlockContext().lookupOuterLocalVariable(getTokenReference(), ident);	if (outer != null) {	  return outer.analyse(context);	}	// Otherwise, outers	if (context.getClassContext().lookupOuterField(context.getClassContext().getCClass(), ident) != null) {	  return createClassField(getTokenReference(), ident).analyse(context);	}	try {	  // Otherwise: TypeName	  CClassType	type = CClassType.lookup(ident);	  type.checkType(context);	  return new JTypeNameExpression(getTokenReference(), type);	} catch (UnpositionedError cue) {	  // Otherwise: PackageName	  throw new CLineError(getTokenReference(), KjcMessages.VAR_UNKNOWN, ident);	}      }      assert(prefix != null);      try {	prefix = prefix.analyse(context);      } catch (CLineError cue) {	if (cue.hasDescription(KjcMessages.VAR_UNKNOWN)) {	  return convertToPackageName(cue, context);	} else {	  throw cue;	}      }      // If the name to the left of the "." is reclassified as a TypeName      if (prefix instanceof JTypeNameExpression) {	if (((JTypeNameExpression)prefix).getClassType().getCClass().lookupField(context.getClassContext().getCClass(), ident) != null) {	  // there is a field	  return createClassField(getTokenReference(), prefix, ident).analyse(context);	} else {	  // no field => should be a type name	  return new JTypeNameExpression(getTokenReference(),					 ((JTypeNameExpression)prefix).getQualifiedName() + "/" + ident);	}      }      // If the name to the left of the "." is reclassified as an ExpressionName      if (ident == Constants.JAV_LENGTH) {	// is it an array access ?	if (prefix.getType().isArrayType()) {	  return new JArrayLengthExpression(getTokenReference(), prefix);	}      }      return createClassField(getTokenReference(), prefix, ident).analyse(context);    } catch (UnpositionedError e) {      throw e.addPosition(getTokenReference());    }  }