AST __t1007 = _t; AST tmp1458_AST_in = (AST)_t;
AST __t992 = _t; AST tmp1462_AST_in = (AST)_t;
	public final void openquerystate(AST _t) throws RecognitionException {				AST openquerystate_AST_in = (_t == ASTNULL) ? null : (AST)_t;				AST __t1007 = _t;		AST tmp1458_AST_in = (AST)_t;		match(_t,OPEN);		_t = _t.getFirstChild();		AST tmp1459_AST_in = (AST)_t;		match(_t,QUERY);		_t = _t.getNextSibling();		AST tmp1460_AST_in = (AST)_t;		match(_t,ID);		_t = _t.getNextSibling();		{		if (_t==null) _t=ASTNULL;		switch ( _t.getType()) {		case FOR:		{			AST tmp1461_AST_in = (AST)_t;			match(_t,FOR);			_t = _t.getNextSibling();			break;		}		case PRESELECT:		{			AST tmp1462_AST_in = (AST)_t;			match(_t,PRESELECT);			_t = _t.getNextSibling();			break;		}		default:		{			throw new NoViableAltException(_t);		}		}		}		for_record_spec(_t,CQ.INIT);		_t = _retTree;		{		_loop1013:		do {			if (_t==null) _t=ASTNULL;			switch ( _t.getType()) {			case QUERYTUNING:			{				querytuningphrase(_t);				_t = _retTree;				break;			}			case BY:			{				AST __t1010 = _t;				AST tmp1463_AST_in = (AST)_t;				match(_t,BY);				_t = _t.getFirstChild();				expression(_t);				_t = _retTree;				{				if (_t==null) _t=ASTNULL;				switch ( _t.getType()) {				case DESCENDING:				{					AST tmp1464_AST_in = (AST)_t;					match(_t,DESCENDING);					_t = _t.getNextSibling();					break;				}				case 3:				{					break;				}				default:				{					throw new NoViableAltException(_t);				}				}				}				_t = __t1010;				_t = _t.getNextSibling();				break;			}			case COLLATE:			{				collatephrase(_t);				_t = _retTree;				break;			}			case INDEXEDREPOSITION:			{				AST tmp1465_AST_in = (AST)_t;				match(_t,INDEXEDREPOSITION);				_t = _t.getNextSibling();				break;			}			case MAXROWS:			{				AST __t1012 = _t;				AST tmp1466_AST_in = (AST)_t;				match(_t,MAXROWS);				_t = _t.getFirstChild();				expression(_t);				_t = _retTree;				_t = __t1012;				_t = _t.getNextSibling();				break;			}			default:			{				break _loop1013;			}			}		} while (true);		}		state_end(_t);		_t = _retTree;		_t = __t1007;		_t = _t.getNextSibling();		_retTree = _t;	}