Skip to content
Advertisement

Which nonterminal is the start symbol?

While i was reading the spec(ECMAScript 2022) i’ve wondered which nonterminal symbol is the start symbol ? in other words the first place that is being evaluated in ECMAScript 2022

Advertisement

Answer

It depends. The abstract operation ParseText is called from 14 places, with different goalSymbols (from the perspective of a bottom-up parser the start symbol of the generative grammar is the goal). The call you are probably looking for comes from ParseScript and passes in the Script non-terminal symbol (though it might also be Module passed in from ParseModule).

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement