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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T13:30:24+00:00 2026-06-12T13:30:24+00:00

When I pass a file to bison (the usual way) it works fine, it

  • 0

When I pass a file to bison (the usual way) it works fine, it parses the file and checks the grammar. However when I pass the same string with:

yy_scan_string(string);
yylex();
yyparse(); 

It crashes after the first token, it says it is expecting $end. Should I somehow reset something? The examples on here don’t say anything.

  • 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-12T13:30:25+00:00Added an answer on June 12, 2026 at 1:30 pm

    You’re using Bison incorrectly. When using Bison, you only call yyparse(). You don’t call yylex()–that function will be called by yyparse() whenever it needs a token.

    What you’re doing is setting string as the input, calling yylex which finds a token and advances the input stream. Then you call yyparse(). This yyparse() call is expecting to find something on the input from the current point (after first token which was grabbed by yylex()) to the end of input which reduces to a sentence in your grammar.

    The problem is that it already missed a token because of your yylex() call.

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

Sidebar

Related Questions

I'm trying to pass a file to another method which takes a String as
Is it possible to upload a file to another server or pass a file
I've seen some shell scripts in which they pass a file by writing the
$importkey = system('gpg --import newkey.asc . $username'); need to pass the file name as
I am trying to pass a .xml file from my res folder to an
i am trying to pass two values to php file via ajax my code
Is it possible to pass a variable to a linked .js file? I tried
If you try to pass the username/password to OpenVPN from a file via the
I am trying to pass in arguments to the a parent file that is
How do you pass a parameter into an include file? I tried the following

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.