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

  • Home
  • SEARCH
  • 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 8115889
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T03:36:40+00:00 2026-06-06T03:36:40+00:00

In some Bison code, what does the following line mean? #define YY_DECL extern C

  • 0

In some Bison code, what does the following line mean?

#define YY_DECL extern "C" int yylex();

I know #define command but I don’t understand the whole command.

  • 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-06T03:36:41+00:00Added an answer on June 6, 2026 at 3:36 am

    It means that YY_DECL will be expanded to

    extern "C" int yylex();
    

    This is actually C++, not C; when you compile this file with a C++ compiler, it declares that the function yylex must be compiled with “C linkage”, so that C functions can call it without trouble.

    If you don’t program in C++, this is largely irrelevant to you, but you may encounter similar declarations in C header files for libraries that try to be compatible with C++. C and C++ can be mixed in a single program, but it requires such declarations for function to nicely work together.

    There’s probably an #ifdef __cplusplus around this #define; that’s a special macro used to indicate compilation by a C++ compiler.

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

Sidebar

Related Questions

I have some bison grammar: input: /* empty */ | input command ; command:
Does anyone knows if there are some tutorials and/or examples of using GNU Bison
I have a Bison rule block: LBRACE { some code } decls stmts RBRACE
Some code for context: class a { } class b { public a a{get;set;}
These days, I use Flex & Bison generated some codes to develop a SQL-parser
I need some help in bison grammar construction. From my another question: I'm trying
I'm attempting to learn some flex/bison, and I'm reading Flex & Bison by John
I have some code written in Ruby 1.9.2 patch level 136 and I'm have
I've written following bison grammar file: %left '+' '-' %left '*' '/' %token NUMBER
I've been using unix for some time, and I would like to know if

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.