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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:25:39+00:00 2026-05-28T02:25:39+00:00

s : cmd | cmd SOMETHING cmd :WORD WORD and SOMETHING are non null

  • 0
s   : cmd
    | cmd SOMETHING 

cmd :WORD

WORD and SOMETHING are non null terminals

it’s an LR1 grammar so bison should parse it without problems.

however i faced an unexpected problem in runtime:
the program prompts for input twice, so for example when i enter “qwerty” it prompt for a second input,when i try to debug it i get this:

Starting parse

Entering state 0

Reading a token: qwerty

Next token is token WORD

Shifting token WORD

Entering state 1

Reducing stack by rule 3 (line 20):

   $1 = token WORD ()

-> $$ = nterm cmd ()

Stack now 0

Entering state 3

Reading a token: 

(asks for input a second time)
  • 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-05-28T02:25:40+00:00Added an answer on May 28, 2026 at 2:25 am

    How will it know which rule for s to employ until it tries to read SOMETHING and either succeeds (second rule) or fails (first rule)? Which means it HAS to ask for the second input.

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

Sidebar

Related Questions

If I do something like this: using (SqlCommand cmd = new SqlCommand(SELECT * FROM
How can I open a cmd window in a specific location without having to
I want to have a cmd file with something like: :one start /wait (blabla1.exe
I wanted to run a .cmd file from Java. I have something which works
I'm looking for something like CTRL + S in emacs or CTRL/CMD + J
When i am adding service to windows manually by typing in CMD something like
I wrote some statements like below: os.system(cmd) #do something subprocess.call('taskkill /F /IM exename.exe') both
I want to do something similar to this using cmd in windows: start dir
I tried something like this, but with no effect: command = cmd.exe proc =
If I execute set PATH=%PATH%;C:\\Something\\bin from the command line ( cmd.exe ) and then

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.