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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T23:00:24+00:00 2026-05-14T23:00:24+00:00

I’ve been working on my own implementation of ECMAScript for quite some time now.

  • 0

I’ve been working on my own implementation of ECMAScript for quite some time now. I have basically done everything by hand to help gain a deep understanding of the process. Repeated attempts to analyze and understand this portion of the grammar have failed so I’ve been working on other portions of the project but now I am at a point were I will be working on object literals so I really need to polish my syntactic analyzer. Can anyone put this in terms a language parser novice could understand?

My biggest source of confusion is the following:

new MemberExpression Arguments

This is supposed to be a member expression, but this seemingly conflicts with the following:

NewExpression :
    MemberExpression 
    new NewExpression

Is a new expression a member expression or a left hand side expression? To be honest I am having trouble laying out the proper C# classes for the concrete grammar.

MemberExpression : 
    PrimaryExpression 
    FunctionExpression 
    MemberExpression [ Expression ] 
    MemberExpression . IdentifierName 
    new MemberExpression Arguments 

NewExpression :
    MemberExpression 
    new NewExpression 

CallExpression :
    MemberExpression Arguments 
    CallExpression Arguments 
    CallExpression [ Expression ] 
    CallExpression . IdentifierName 

LeftHandSideExpression :
    NewExpression 
    CallExpression 

This is the class design I’ve been working with but as I continue to study the spec my doubts just won’t go away.

public abstract class LeftHandSideExpression : ConcreteExpression
{

}

public sealed class NewExpression : LeftHandSideExpression
{
    public NewExpression(MemberExpression memberExpression, Arguments arguments)
    {

    }

    public NewExpression(NewExpression newExpression, Arguments arguments)
    {

    }        
}

public sealed class CallExpression : LeftHandSideExpression
{
    public CallExpression(MemberExpression memberExpression, Arguments arguments)
    {

    }

    public CallExpression(CallExpression callExpression, Arguments arguments)
    {

    }
}

public sealed class MemberExpression : ConcreteExpression
{
    public MemberExpression(PrimaryExpression primaryExpression)
    {

    }

    public MemberExpression(PrimaryExpression primaryExpression, string identifierName)
    {

    }

    public MemberExpression(PrimaryExpression primaryExpression, ConcreteExpression indexerExpression)
    {

    }

    public MemberExpression(FunctionExpression functionExpression)
    {

    }

    public MemberExpression(FunctionExpression functionExpression, string identifierName)
    {

    }

    public MemberExpression(FunctionExpression functionExpression, ConcreteExpression indexerExpression)
    {

    }
}

Based off of Andy’s answer I came up with a new design that makes sense.

public abstract class LeftHandSideExpression : ConcreteExpression
{
    public ConcreteExpression Expression { get; private set; }

    protected LeftHandSideExpression(ConcreteExpression expression)
    {
        Expression = expression;
    }
}

public class NewExpression : LeftHandSideExpression
{
    public Arguments Arguments { get; private set; }

    protected NewExpression(PrimaryExpression primaryExpression)
        : base(primaryExpression)
    {

    }

    protected NewExpression(FunctionExpression functionExpression)
        : base(functionExpression)
    {

    }

    protected NewExpression(MemberExpression memberExpression)
        : base(memberExpression)
    {

    }

    protected NewExpression(CallExpression callExpression)
        : base(callExpression)
    {

    }

    public NewExpression(MemberExpression memberExpression, Arguments arguments)
        : base(memberExpression)
    {
        Arguments = arguments;
    }

    public NewExpression(NewExpression newExpression, Arguments arguments)
        : base(newExpression)
    {
        Arguments = arguments;
    }      
}

public sealed class CallExpression : LeftHandSideExpression
{
    public Arguments Arguments { get; private set; }

    public CallExpression(MemberExpression memberExpression, Arguments arguments)
        : base(memberExpression)
    {
        Arguments = arguments;
    }

    public CallExpression(CallExpression callExpression, Arguments arguments)
        : base(callExpression)
    {
        Arguments = arguments;
    }
}

public class MemberExpression : NewExpression
{
    public MemberExpression(PrimaryExpression primaryExpression)
        : base(primaryExpression)
    {

    }

    public MemberExpression(FunctionExpression functionExpression)
        : base(functionExpression)
    {

    }

    public MemberExpression(MemberExpression memberExpression)
        : base(memberExpression)
    {

    }

    protected MemberExpression(CallExpression callExpression)
        : base(callExpression)
    {

    }
}

public sealed class DotPropertyAccessExpression : MemberExpression
{
    public string IdentifierName { get; private set; }

    public DotPropertyAccessExpression(PrimaryExpression primaryExpression, string identifierName)
        : base(primaryExpression)
    {
        IdentifierName = identifierName;
    }

    public DotPropertyAccessExpression(FunctionExpression functionExpression, string identifierName)
        : base(functionExpression)
    {
        IdentifierName = identifierName;
    }

    public DotPropertyAccessExpression(MemberExpression memberExpression, string identifierName)
        : base(memberExpression)
    {
        IdentifierName = identifierName;
    }

    public DotPropertyAccessExpression(CallExpression callExpression, string identifierName)
        : base(callExpression)
    {
        IdentifierName = identifierName;
    }
}

public sealed class BracketPropertyAccessExpression : MemberExpression
{
    public ConcreteExpression IndexerExpression { get; private set; }

    public BracketPropertyAccessExpression(PrimaryExpression primaryExpression, ConcreteExpression indexerExpression)
        : base(primaryExpression)
    {
        IndexerExpression = indexerExpression;
    }

    public BracketPropertyAccessExpression(FunctionExpression functionExpression, ConcreteExpression indexerExpression)
        : base(functionExpression)
    {
        IndexerExpression = indexerExpression;
    }

    public BracketPropertyAccessExpression(MemberExpression memberExpression, ConcreteExpression indexerExpression)
        : base(memberExpression)
    {
        IndexerExpression = indexerExpression;
    }

    public BracketPropertyAccessExpression(CallExpression callExpression, ConcreteExpression indexerExpression)
        : base(callExpression)
    {
        IndexerExpression = indexerExpression;
    }
}
  • 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-14T23:00:25+00:00Added an answer on May 14, 2026 at 11:00 pm

    Here’s a different way of visualizing it. This is the way I see the general hierarchy of productions in section 11.2:

    LeftHandSideExpression :
        NewExpression :
            MemberExpression :
                PrimaryExpression
                FunctionExpression
                MemberExpression [ Expression ]
                MemberExpression . IdentifierName
                new MemberExpression Arguments
            new NewExpression
        CallExpression :
            MemberExpression Arguments
            CallExpression Arguments
            CallExpression [ Expression ]
            CallExpression . IdentifierName
    

    It looks like MemberExpressions are NewExpressions, which are, in turn, LeftHandSideExpressions. I hope this helps.

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

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I have some data like this: 1 2 3 4 5 9 2 6
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
Basically, what I'm trying to create is a page of div tags, each has
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into

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.