else {
	int process_ancestor_or_self(VTDNav vn)		throws XPathEvalException,NavException{	    boolean b = false;	    int result;		switch ( state) {		case  START:		    // if this step contains any predicate that		    // require context size		    // needs to precompute the context size		    // vn.push2();		    // computerContext();		    // set contxt();		    // vn.pop2()		    // if the context size is zero		    // get immediately set teh state to end		    // or backward			 state =  END;			vn.push2();						if (currentStep.get_ft()== true){										currentStep.set_ft(false);				if (currentStep.eval(vn)) {					if (currentStep.getNextStep() != null) {						 state =  FORWARD;						currentStep = currentStep.getNextStep();						break;					} else {						//vn.pop();						 state =  TERMINAL;						result = vn.getCurrentIndex();						if ( isUnique(result))							return result;					}				}			}			else {				while (vn.toElement(VTDNav.P)) {					if (currentStep.eval(vn)) {						if (currentStep.getNextStep() != null) {							 state =  FORWARD;							currentStep = currentStep.getNextStep();							break;						} else {							//vn.pop();							 state =  TERMINAL;							result = vn.getCurrentIndex();							if ( isUnique(result))								return result;						}					}				}			}			if ( state ==  END) {				currentStep.resetP(vn);				vn.pop2();			}			break;					case  FORWARD:		    // if this step contains any predicate that		    // require context size		    // needs to precompute the context size		    // vn.push2();		    // computerContext();		    // set contxt();		    // vn.pop2()		    // if the context size is zero		    // get immediately set teh state to end		    // or backward			 state =  BACKWARD;			vn.push2();			if (currentStep.get_ft() == true) {				currentStep.set_ft(false);				if (currentStep.eval(vn)) {					if (currentStep.getNextStep() != null) {						 state =  FORWARD;						currentStep = currentStep.getNextStep();						break;					} else {						//vn.pop();						 state =  TERMINAL;						result = vn.getCurrentIndex();						if ( isUnique(result))							return result;					}				}			} else {				while (vn.toElement(VTDNav.P)) {					if (currentStep.eval(vn)) {						if (currentStep.getNextStep() != null) {							 state =  FORWARD;							currentStep = currentStep.getNextStep();							break;						} else {							//vn.pop();							 state =  TERMINAL;							result = vn.getCurrentIndex();							if ( isUnique(result))								return result;						}					}				}			}			if ( state ==  BACKWARD) {				currentStep.resetP(vn);				currentStep.set_ft(true);				vn.pop2();				currentStep = currentStep.getPrevStep();			}			break;				case  END:			currentStep = null;			// reset();	    	return -1;							case  BACKWARD:			b = false;			vn.push2();			while (vn.toElement(VTDNav.P)) {				if (currentStep.eval(vn)) {					if (currentStep.getNextStep() != null) {						 state =  FORWARD;						currentStep = currentStep.getNextStep();						b = true;						break;					} else {						//vn.pop();						 state =  TERMINAL;						result = vn.getCurrentIndex();						if ( isUnique(result))							return result;					}				}			}			if (b == false) {				vn.pop2();				currentStep.resetP(vn);				if (currentStep.getPrevStep() != null) {					currentStep.set_ft(true);					 state =  BACKWARD;					currentStep = currentStep.getPrevStep();				} else {					 state =  END;				}			}			break;				case  TERMINAL:			while (vn.toElement(VTDNav.P)) {				if (currentStep.eval(vn)) {					result = vn.getCurrentIndex();					if ( isUnique(result))						return result;				}			}			vn.pop2();			currentStep.resetP(vn);			if (currentStep.getPrevStep()!=null) {				currentStep.set_ft(true);				 state =  BACKWARD;				currentStep = currentStep.getPrevStep();			}			else {				 state =  END;			}			break;							default:			throw new  XPathEvalException("unknown state");		}		return -2;	}