I need help translating this portion of the ECMAScript grammar?
- by ChaosPandion
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 the run time instead. 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