static public Identifier toIdentifier(Expression e){
  StringBuffer buf=new StringBuffer();
  while (e.op == FIELD) {
    FieldExpression fe=(FieldExpression)e;
    if (fe.id == idThis || fe.id == idClass) {
      return null;
    }
    buf.insert(0,fe.id);
    buf.insert(0,'.');
    e=fe.right;
  }
  if (e.op != IDENT) {
    return null;
  }
  buf.insert(0,((IdentifierExpression)e).id);
  return Identifier.lookup(buf.toString());
}

static public Identifier toIdentifier ( Expression e ) { StringBuffer buf = new StringBuffer ( ) ; while ( e . op == FIELD ) { FieldExpression fe = ( FieldExpression ) e ; if ( fe . id == idThis || fe . id == idClass ) { return null ; } buf . insert ( 0 , fe . id ) ; buf . insert ( 0 , '.' ) ; e = fe . right ; } if ( e . op != IDENT ) { return null ; } buf . insert ( 0 , ( ( IdentifierExpression ) e ) . id ) ; return Identifier . lookup ( buf . toString ( ) ) ; }
convert an ' . ' expression to a qualified identifier
