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 9171145
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:07:23+00:00 2026-06-17T16:07:23+00:00

I am new to lexical analysis and parser generation, and I tried to start

  • 0

I am new to lexical analysis and parser generation, and I tried to start directly by compiling the bison example from wikipedia. This is an example of a reentrant parser.

I tried to compile with 2 versions of bison: 2.5 and 2.6.5. The former compiles and executes perfectly, but the latter includes the type yyscan_t in the parser header which is declared in the lexer header (Lexer.h) (which I guess is required for reentrant features). Hence it does not compile Parser.c generated by Parser.y

Here is the extra part generated in Parser.h by 2.6.5 which is not present in 2.5:

#ifdef YYPARSE_PARAM
#if defined __STDC__ || defined __cplusplus
int yyparse (void *YYPARSE_PARAM);
#else
int yyparse ();
#endif
#else /* ! YYPARSE_PARAM */
#if defined __STDC__ || defined __cplusplus
int yyparse (SExpression **expression, yyscan_t scanner); // this line
#else
int yyparse ();
#endif
#endif /* ! YYPARSE_PARAM */

I’ve marked the line causing the problem. Any thoughts?

Edit: What I need to do is to ensure that yyscan_t is declared in the header file generated by bison.

  • 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-17T16:07:24+00:00Added an answer on June 17, 2026 at 4:07 pm

    Indeed, bison since 2.6 inserts the previously mentionned block of code in the header section.

    You need to tell bison to insert all the declarations of the yyparse function arguments before this block by moving a subsection of what was part of a %code {…} (or %{…%}) section into a new code section with the tag ‘requires’ so for it to be inserted at the top of the header, in your yy file:

    %code requires {
    typedef void*                 yyscan_t;
    } 
    

    See the bison fraking manual:

    http://www.gnu.org/software/bison/manual/html_node/_0025code-Summary.html

    http://www.gnu.org/software/bison/manual/html_node/Prologue-Alternatives.html#Prologue-Alternatives

    Hope that helps

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

Sidebar

Related Questions

New to PHP and MySQL, have heard amazing things about this website from Leo
I'm currently writing an expression parser. I've done the lexical and syntactic analysis and
New to Regex. I want to validate to this format: Any character allowed, except
New programmer here, I am trying to understand and break down this code below
consider the following example: public IEnumerable<String> Test () { IEnumerable<String> lexicalStrings = new List<String>
The reason I don't understand why Emacs 24's new lexical scoping features are that
I was experimenting with interplay between Emacs lexical scoping (new feature of Emacs 24)
final Object o; List l = new ArrayList(){{ // closure over o, in lexical
I read on this question and answer, where you must create a new DateTime
I am new to this iPhone development and i have almost completed my first

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.