public final void literal() throws RecognitionException
    {
        Token val = null;
        
        try {
            // CPP.g:821:3: (val= CHARACTER_LITERAL | val= STRING_LITERAL | val= HEX_LITERAL | val=
            // DECIMAL_LITERAL | val= OCTAL_LITERAL | val= FLOATING_POINT_LITERAL )
            int alt52 = 6;
            switch (this.input.LA(1))
            {
                case CHARACTER_LITERAL:
                {
                    alt52 = 1;
                }
                    break;
                case STRING_LITERAL:
                {
                    alt52 = 2;
                }
                    break;
                case HEX_LITERAL:
                {
                    alt52 = 3;
                }
                    break;
                case DECIMAL_LITERAL:
                {
                    alt52 = 4;
                }
                    break;
                case OCTAL_LITERAL:
                {
                    alt52 = 5;
                }
                    break;
                case FLOATING_POINT_LITERAL:
                {
                    alt52 = 6;
                }
                    break;
                default:
                    if (this.state.backtracking > 0) {
                        this.state.failed = true;
                        return;
                    }
                    NoViableAltException nvae = new NoViableAltException("", 52, 0, this.input);
                    
                    throw nvae;
            }
            
            switch (alt52)
            {
                case 1:
                    // CPP.g:821:5: val= CHARACTER_LITERAL
                {
                    val = (Token) this.match(this.input, CHARACTER_LITERAL, FOLLOW_CHARACTER_LITERAL_in_literal3727);
                    if (this.state.failed) {
                        return;
                    }
                    if (this.state.backtracking == 0) {
                        this.out = new CharLiteralAST(val);
                    }
                    
                }
                    break;
                case 2:
                    // CPP.g:822:5: val= STRING_LITERAL
                {
                    val = (Token) this.match(this.input, STRING_LITERAL, FOLLOW_STRING_LITERAL_in_literal3737);
                    if (this.state.failed) {
                        return;
                    }
                    if (this.state.backtracking == 0) {
                        this.out = new StringLiteralAST(val);
                    }
                    
                }
                    break;
                case 3:
                    // CPP.g:823:5: val= HEX_LITERAL
                {
                    val = (Token) this.match(this.input, HEX_LITERAL, FOLLOW_HEX_LITERAL_in_literal3747);
                    if (this.state.failed) {
                        return;
                    }
                    if (this.state.backtracking == 0) {
                        this.out = new IntLiteralAST(val);
                    }
                    
                }
                    break;
                case 4:
                    // CPP.g:824:5: val= DECIMAL_LITERAL
                {
                    val = (Token) this.match(this.input, DECIMAL_LITERAL, FOLLOW_DECIMAL_LITERAL_in_literal3757);
                    if (this.state.failed) {
                        return;
                    }
                    if (this.state.backtracking == 0) {
                        this.out = new IntLiteralAST(val);
                    }
                    
                }
                    break;
                case 5:
                    // CPP.g:825:5: val= OCTAL_LITERAL
                {
                    val = (Token) this.match(this.input, OCTAL_LITERAL, FOLLOW_OCTAL_LITERAL_in_literal3767);
                    if (this.state.failed) {
                        return;
                    }
                    if (this.state.backtracking == 0) {
                        this.out = new IntLiteralAST(val);
                    }
                    
                }
                    break;
                case 6:
                    // CPP.g:826:5: val= FLOATING_POINT_LITERAL
                {
                    val =
                          (Token) this.match(this.input, FLOATING_POINT_LITERAL,
                                             FOLLOW_FLOATING_POINT_LITERAL_in_literal3777);
                    if (this.state.failed) {
                        return;
                    }
                    if (this.state.backtracking == 0) {
                        this.out = new FloatLiteralAST(val);
                    }
                    
                }
                    break;
                
            }
        }
        catch (RecognitionException re) {
            this.reportError(re);
            this.recover(this.input, re);
        } finally {
        }
        return;
    }