case 121:
	public final void primaryExpr() throws RecognitionException, TokenStreamException {				returnAST = null;		ASTPair currentAST = new ASTPair();		AST primaryExpr_AST = null;		String varName= null;				switch ( LA(1)) {		case NCNAME:		case XQUERY:		case VERSION:		case LITERAL_namespace:		case LITERAL_default:		case LITERAL_function:		case LITERAL_variable:		case LITERAL_as:		case LITERAL_empty:		case LITERAL_item:		case LITERAL_for:		case LITERAL_let:		case LITERAL_if:		case LITERAL_order:		case LITERAL_by:		case LITERAL_then:		case LITERAL_else:		case LITERAL_or:		case LITERAL_and:		case LITERAL_div:		case LITERAL_mod:		case LITERAL_union:		case LITERAL_intersect:		case LITERAL_except:		case LITERAL_text:		case LITERAL_node:		case LITERAL_child:		case LITERAL_self:		case LITERAL_attribute:		case LITERAL_descendant:		case 115:		case 116:		case LITERAL_parent:		case LITERAL_ancestor:		case 119:		case 120:		case LITERAL_comment:		case LITERAL_document:		case LITERAL_collection:		{			functionCall();			astFactory.addASTChild(currentAST, returnAST);			primaryExpr_AST = (AST)currentAST.root;			break;		}		case SELF:		{			contextItemExpr();			astFactory.addASTChild(currentAST, returnAST);			primaryExpr_AST = (AST)currentAST.root;			break;		}		case LPAREN:		{			parenthesizedExpr();			astFactory.addASTChild(currentAST, returnAST);			primaryExpr_AST = (AST)currentAST.root;			break;		}		case DOLLAR:		{			match(DOLLAR);			varName=qName();			astFactory.addASTChild(currentAST, returnAST);			if ( inputState.guessing==0 ) {				primaryExpr_AST = (AST)currentAST.root;				primaryExpr_AST= astFactory.create(VARIABLE_REF,varName);				currentAST.root = primaryExpr_AST;				currentAST.child = primaryExpr_AST!=null &&primaryExpr_AST.getFirstChild()!=null ?					primaryExpr_AST.getFirstChild() : primaryExpr_AST;				currentAST.advanceChildToEnd();			}			primaryExpr_AST = (AST)currentAST.root;			break;		}		case LT:		case XML_COMMENT:		case XML_PI:		{			constructor();			astFactory.addASTChild(currentAST, returnAST);			primaryExpr_AST = (AST)currentAST.root;			break;		}		case STRING_LITERAL:		case DOUBLE_LITERAL:		case DECIMAL_LITERAL:		case INTEGER_LITERAL:		{			literal();			astFactory.addASTChild(currentAST, returnAST);			primaryExpr_AST = (AST)currentAST.root;			break;		}		default:		{			throw new NoViableAltException(LT(1), getFilename());		}		}		returnAST = primaryExpr_AST;	}