public final void exprPrimary() throws RecognitionException
    {
        Token id = null;
        
        try {
            // CPP.g:775:3: ( literal | id= IDENTIFIER | '(' expr ')' | callExpr | arrayElement )
            int alt50 = 5;
            switch (this.input.LA(1))
            {
                case CHARACTER_LITERAL:
                case STRING_LITERAL:
                case HEX_LITERAL:
                case DECIMAL_LITERAL:
                case OCTAL_LITERAL:
                case FLOATING_POINT_LITERAL:
                {
                    alt50 = 1;
                }
                    break;
                case IDENTIFIER:
                {
                    switch (this.input.LA(2))
                    {
                        case 42:
                        {
                            alt50 = 4;
                        }
                            break;
                        case 25:
                        {
                            alt50 = 5;
                        }
                            break;
                        case EOF:
                        case 23:
                        case 24:
                        case 26:
                        case 27:
                        case 29:
                        case 30:
                        case 43:
                        case 44:
                        case 52:
                        case 57:
                        case 58:
                        case 59:
                        case 60:
                        case 61:
                        case 62:
                        case 63:
                        case 64:
                        case 65:
                        case 66:
                        case 67:
                        case 68:
                        case 69:
                        case 70:
                        case 71:
                        case 72:
                        case 73:
                        case 74:
                        case 75:
                        case 76:
                        case 77:
                        case 78:
                        case 79:
                        case 80:
                        case 81:
                        case 82:
                        case 83:
                        case 84:
                        case 85:
                        {
                            alt50 = 2;
                        }
                            break;
                        default:
                            if (this.state.backtracking > 0) {
                                this.state.failed = true;
                                return;
                            }
                            NoViableAltException nvae = new NoViableAltException("", 50, 2, this.input);
                            
                            throw nvae;
                    }
                    
                }
                    break;
                case 42:
                {
                    alt50 = 3;
                }
                    break;
                default:
                    if (this.state.backtracking > 0) {
                        this.state.failed = true;
                        return;
                    }
                    NoViableAltException nvae = new NoViableAltException("", 50, 0, this.input);
                    
                    throw nvae;
            }
            
            switch (alt50)
            {
                case 1:
                    // CPP.g:775:5: literal
                {
                    this.pushFollow(FOLLOW_literal_in_exprPrimary3512);
                    this.literal();
                    
                    this.state._fsp--;
                    if (this.state.failed) {
                        return;
                    }
                    
                }
                    break;
                case 2:
                    // CPP.g:776:5: id= IDENTIFIER
                {
                    id = (Token) this.match(this.input, IDENTIFIER, FOLLOW_IDENTIFIER_in_exprPrimary3521);
                    if (this.state.failed) {
                        return;
                    }
                    if (this.state.backtracking == 0) {
                        this.out = new VarExprAST(id);
                    }
                    
                }
                    break;
                case 3:
                    // CPP.g:777:5: '(' expr ')'
                {
                    this.match(this.input, 42, FOLLOW_42_in_exprPrimary3529);
                    if (this.state.failed) {
                        return;
                    }
                    this.pushFollow(FOLLOW_expr_in_exprPrimary3531);
                    this.expr();
                    
                    this.state._fsp--;
                    if (this.state.failed) {
                        return;
                    }
                    this.match(this.input, 43, FOLLOW_43_in_exprPrimary3533);
                    if (this.state.failed) {
                        return;
                    }
                    
                }
                    break;
                case 4:
                    // CPP.g:778:5: callExpr
                {
                    this.pushFollow(FOLLOW_callExpr_in_exprPrimary3540);
                    this.callExpr();
                    
                    this.state._fsp--;
                    if (this.state.failed) {
                        return;
                    }
                    
                }
                    break;
                case 5:
                    // CPP.g:779:5: arrayElement
                {
                    this.pushFollow(FOLLOW_arrayElement_in_exprPrimary3547);
                    this.arrayElement();
                    
                    this.state._fsp--;
                    if (this.state.failed) {
                        return;
                    }
                    
                }
                    break;
                
            }
        }
        catch (RecognitionException re) {
            this.reportError(re);
            this.recover(this.input, re);
        } finally {
        }
        return;
    }