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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T19:53:55+00:00 2026-05-15T19:53:55+00:00

According to the ECMAScript specification in section 7.8.1 a NullLiteral is defined as follows:

  • 0

According to the ECMAScript specification in section 7.8.1 a NullLiteral is defined as follows:

NullLiteral :: 
    null

What I am trying to understand is how this is represented in tree form when a NullLiteral is included in the following productions found in sections 7.6.1 and 7.8.

ReservedWord :: 
    Keyword 
    FutureReservedWord 
    NullLiteral 
    BooleanLiteral 
Literal :: 
    NullLiteral 
    BooleanLiteral 
    NumericLiteral 
    StringLiteral 

My best guess as to how it would look is this:

InputElementDiv
    |
  Token
    |
IdentifierName
    |
ReservedWord 
    |
 Literal 
    |
NullLiteral 
    |
   null

This just does not seem right to me though.

Note

From my research it seems that very few compilers actually generate CSTs from the language grammar. I can of course understand why but this is a learning exercise for me so I want to get this right before I move to more professional means of parsing such as using a parser generator.

  • 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-15T19:53:55+00:00Added an answer on May 15, 2026 at 7:53 pm

    The tree as shown is not covered by the grammar, because that does not provide a derivation from IdentifierName to ReservedWord, and it does not provide for deriving ReservedWord to Literal either.

    The ReservedWord production in fact is used only to restrict valid values of IdentifierName, and this should be seen on the lexical level. It does not make it into a CST, where you would see just the IdentifierName.

    The context of Literal is PrimaryExpression, so a fragment of a real CST could look like this:

       ...
        |
    PrimaryExpression
        |
     Literal 
        |
    NullLiteral 
        |
       null
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

According to this discussion , the iphone agreement says that it doesn't allow loading
According to MSDN form.RightToLeftLayout = True; form.RightToLeft = ifWeWantRTL() ? RightToLeft.True : RightToLeft.False; is
According to the answers to this question, I cannot embed a file version in
According to this article Silverlight 2 Beta 2 supports the DataContractJsonSerializer object. But, when
According to Steffen's post this is an efficient way to generate random BOOL s
According to JavaScript Patterns book (p. 79), this should work: var ob = {
according to my knowledge, this feature already exists in PHP. lets look at the
According to the ECMA-262 a native object object in an ECMAScript implementation whose semantics
According to the dataset specification , how is element.dataset meant to delete data attributes?
According To reflector , ExpandoObject Does implemenet IDictionary<string, object> How ever I have this

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.