Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7821487
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T07:40:00+00:00 2026-06-02T07:40:00+00:00

I am writing a parser with Bison and I am getting the following warnings.

  • 0

I am writing a parser with Bison and I am getting the following warnings.

fol.y:42 parser name defined to default :"parse"
fol.y:61:  warning:  type clash ('' 'pred') on default action

I have been using Google to search for a way to get rid of them, but have pretty much come up empty handed on what they mean (much less how to fix them) since every post I found with them has a compilation error and the warnings them selves aren’t addressed. Could someone tell me what they mean and how to fix them? The relevant code is below. Line 61 is the last semicolon. I cut out the rest of the grammar since it is incredibly verbose.

%union {
    char* var;
    char* name;
    char* pred;
}


%token <var> VARIABLE
%token <name> NAME
%token <pred> PRED

%%


fol:
        declines clauses {cout << "Done parsing with file" << endl;}
        ;
declines:
        declines decline
        |decline
        ;
decline:
        PRED decs
        ;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T07:40:01+00:00Added an answer on June 2, 2026 at 7:40 am

    The first message is likely just a warning that you didn’t include %start parse in the grammar specification.

    The second means that somewhere you have rule that is supposed to return a value but you haven’t properly specified which type of value it is to return. The PRED returns the pred element of your union; the problem might be that you’ve not created %type entries for decline and declines. If you have a union, you have to specify the type for most, if not all, rules — or maybe just rules that don’t have an explicit action (so as to override the default $$ = $1; action).

    I’m not convinced that the problem is in the line you specify, and because we don’t have a complete, minimal reproduction of your problem, we can’t investigate for you to validate it. The specification for decs may be relevant (I’m not convinced it is, but it might be).

    You may get more information from the output of bison -v, which is the y.output file (or something similar).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What I'm trying to do this is writing a simple parser for the following
I'm writing a parser in Bison for a basic compiler (and then expand it
Im writing a parser than can parse expressions like myfunc1() , myfunc2(param1) and myfunc3(param1,
I'm writing a Python parser to learn Flex and Bison, and I'm trying to
I'm writing an parser for iTunes XML file and I'm trying to parse the
I am writing a parser to parse incoming text files. I have it to
I'm writing a parser using Bison, and am using a map for semantic evaluation.
I am writing a parser with flex and bison and so far have these
I'm currently writing a parser for a simple programming language. It's getting there however
I'm writing a parser for a very simple grammar in javacc. It's beginning to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.