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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T00:44:36+00:00 2026-05-18T00:44:36+00:00

Recently I’ve been studying parsers and grammars and how they work. I was reading

  • 0

Recently I’ve been studying parsers and grammars and how they work. I was reading over the formal grammar for JSON at http://www.ietf.org/rfc/rfc4627.txt, which uses EBNF. I was pretty confident in my understanding of BNF and EBNF, but apparently I still don’t fully understand it. The RFC defines a JSON object like this:

  object = begin-object [ member *( value-separator member ) ]
  end-object

I understand that the intent here is to express that any JSON object can (optionally) have a member, and then be followed by 0 or more (value-separator, member) pairs. What I don’t understand is why the asterisk appears before the (value-separator member). Isn’t the asterisk supposed to mimic regex, so that it appears after the item to be repeated 0 or more times? Shouldn’t the JSON object grammar be written like this:

  object = begin-object [ member ( value-separator member )* ]
  end-object
  • 1 1 Answer
  • 1 View
  • 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-18T00:44:37+00:00Added an answer on May 18, 2026 at 12:44 am

    Syntax is about the way somebody chooses to write down concrete entities to represent something.

    I’ll agree that puttting Kleene star before the entity to repeated is non-standard, and the authors choice
    to do that simply confuses people that are used to convention. But it is perfectly valid; the authors
    get to define what syntax means, and you, the user of the standard, just get to accept it.

    There’s some argument for putting the Kleene star where he did; it indicates that there is list
    following at a point where you might expect a list. The suffix-style Kleene star indicates
    the same, but it is sort of a surprise; first you read the list element (from left to right),
    then you discover the star.

    As a practical matter, the surprise factor of post-Kleene-star isn’t enough in general to outweigh the surprise factor of violating convention. But the authors of that standard made their choice.

    Welcome to syntax.

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

Sidebar

Related Questions

Recently I came across command line to find damaged JPEG here at http://www.commandlinefu.com/commands/view/2352/find-corrupted-jpeg-image-files .
Recently, I ran into a problem with my application: the size of the JSON
Recently, when I tried to show the results of my work (some Flex app)
Recently I've been doing a lot of these enum Thing { /* etc etc
Recently I started reading (just a bit) the current draft for the future C++11
Recently there have been a lot of move towards MVVM framework due to the
Recently I've been doing things like this: import Tkinter class C(object): def __init__(self): self.root
Recently finished reading Eric Evans Domain Driven Design (very informative, very enjoyable) however come
Recently I have been working with a SQL Server database and I was trying
Recently I've been maintaining a legacy project written in VC++ 6.0. The code uses

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.