AST __t221 = _t;
AST __t226 = _t;
	public final void functionDecl(AST _t,		PathExpr path	) throws RecognitionException, PermissionDeniedException,EXistException,XPathException {				AST functionDecl_AST_in = (AST)_t;		AST name = null;				AST __t221 = _t;		name = _t==ASTNULL ? null :(AST)_t;		match(_t,FUNCTION_DECL);		_t = _t.getFirstChild();		PathExpr body= new PathExpr(context);							QName qn= QName.parse(context, name.getText());					FunctionSignature signature= new FunctionSignature(qn);					UserDefinedFunction func= new UserDefinedFunction(context, signature);					List varList= new ArrayList(3);						{		if (_t==null) _t=ASTNULL;		switch ( _t.getType()) {		case VARIABLE_BINDING:		{			paramList(_t,varList);			_t = _retTree;			break;		}		case LCURLY:		case LITERAL_as:		{			break;		}		default:		{			throw new NoViableAltException(_t);		}		}		}							SequenceType[] types= new SequenceType[varList.size()];					int j= 0;					for (Iterator i= varList.iterator(); i.hasNext(); j++) {						FunctionParameter param= (FunctionParameter) i.next();						types[j]= param.type;						func.addVariable(param.varName);					}					signature.setArgumentTypes(types);					context.declareFunction(func);						{		if (_t==null) _t=ASTNULL;		switch ( _t.getType()) {		case LITERAL_as:		{			AST __t224 = _t;			AST tmp26_AST_in = (AST)_t;			match(_t,LITERAL_as);			_t = _t.getFirstChild();			SequenceType type= new SequenceType();			sequenceType(_t,type);			_t = _retTree;			signature.setReturnType(type);			_t = __t224;			_t = _t.getNextSibling();			break;		}		case LCURLY:		{			break;		}		default:		{			throw new NoViableAltException(_t);		}		}		}		AST __t225 = _t;		AST tmp27_AST_in = (AST)_t;		match(_t,LCURLY);		_t = _t.getFirstChild();		expr(_t,body);		_t = _retTree;		func.setFunctionBody(body);		_t = __t225;		_t = _t.getNextSibling();		_t = __t221;		_t = _t.getNextSibling();		_retTree = _t;	}