On 10/22/07 10:40 AM, Joel Reymont wrote:

> Folks,

>

> I'm trying to create a Yacc grammar for ES4 and I have trouble

> understanding the notation used in the spec.

>

> For example, there's

>

> alpha = { allowColon, noColon }

> beta = { allowIn, noIn }

> gamma = { allowExpr, noExpr }

>

> and then

>

> ParenExpression ( AssignmentExpression /allowColon, allowIn/ )

>

> as well as

>

> FunctionExpression /alpha, beta/

> function Identifier FunctionSignature FunctionExpressionBody /

> alpha, beta/

> function FunctionSignature FunctionExpressionBody /alpha, beta/

>

> How should I interpret these?

>

Alpha, beta, etc are a short-hand for describing similar productions. They

can be expanded by replicating the parameterised production for each value

in the corresponding set. E.g.

A(alpha) := B(alpha)

can be rewritten as:

A_allowColon := B_allowColon

A_noColon := B_noColon

The original description of this notation can be found here:

http://www.mozilla.org/js/language/grammar14.html> I also see other notation such as omega, tau, local, global, etc. Are

> these documented somewhere?

Yes, in the grammar

Jd

_______________________________________________

Es4-discuss mailing list

[hidden email]
https://mail.mozilla.org/listinfo/es4-discuss