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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T02:50:42+00:00 2026-05-18T02:50:42+00:00

Every LR(0) grammar is SLR(1) but vice versa need not necessarily be true, why?

  • 0

Every LR(0) grammar is SLR(1) but vice versa need not necessarily be true, why?

  • 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-18T02:50:42+00:00Added an answer on May 18, 2026 at 2:50 am

    Basically, an SLR(1) grammar can resolve shift-reduce conflicts that exist in a corresponding LR(0) grammar. Take the example grammar on Wikipedia’s SLR parser page (which explains this at a lower, more rigorous level):

    1. S → E
    2. E → 1 E
    3. E → 1

    When an LR(0) parser is parsing an E and a “1” is the next input symbol, it could recognize E and reduce (rule 3) or it could shift in order to parse a following E (rule 2). Because it can’t look ahead, an LR(0) can’t determine which to do. This becomes more obvious if we look at the items the LR(0) could be processing when it encounters a “1” (the end-of-string symbol has been added):

    • E → 1 • E $
    • E → 1 • $

    The first would require a shift, the second requires a reduce.

    With the above grammar, an SLR(1) grammar can look ahead one symbol and determine which action to take. E can only be followed by $, so a reduce action is only valid at the end of string. This corresponds to the second item, where you can see the next symbol is a “$”.

    For another example grammar that is SLR(1) and not LR(0), see Fegaras’ notes for CSE 5317/4305 at the University of Texas.

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

Sidebar

Related Questions

Every thing goes in code, but not saving data in SQLite db. Can any
This is a very simple task in every language I have ever used, but
I need some help in bison grammar construction. From my another question: I'm trying
Every drop down list that has the property autopostback set to true throws the
NOTE: I am not a native English speaker. Please excuse any grammar mistakes. I
Every once in a while, but especially prevalent on Facebook, Opera Mini will exhibit
every thing seems right but cant find out the reason for error.. i followed
Is every LL(1) grammar also an LR(1)?
Every time I have to get an element that might not exist from an
Every example I find of anyone implementing plugins in android seems to use aexp.intent.action.

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.