Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <h3 id="Section_5.1.4">5.1.4 The Syntactic Grammar</h3>
- The <i class="ss4i">syntactic grammar</i> for ECMAScript is given in clauses <a href="ELS5_Section_11.htm#Section_11">11</a>, <a href="ELS5_Section_12.htm#Section_12">12</a>,
- <a href="ELS5_Section_13.htm#Section_13">13</a> and <a href="ELS5_Section_14.htm#Section_14">14</a>. This grammar has ECMAScript
- tokens defined by the lexical grammar as its terminal symbols (<a href="ELS5_Section_5.htm#Section_5.1.2">5.1.2</a>). It defines a set of productions, starting
- from the goal symbol <i>Program</i>, that describe how sequences of tokens can form syntactically correct
- ECMAScript programs.
- <br><br>
- When a stream of characters is to be parsed as an ECMAScript program, it is first converted to a stream of
- input elements by repeated application of the lexical grammar; this stream of input elements is then parsed by
- a single application of the syntactic grammar. The program is syntactically in error if the tokens in the stream
- of input elements cannot be parsed as a single instance of the goal nonterminal <i>Program</i>, with no tokens left
- over.
- <br><br>
- Productions of the syntactic grammar are distinguished by having just one colon "<b>:</b>" as punctuation.
- <br><br>
- The syntactic grammar as presented in clauses <a href="ELS5_Section_11.htm#Section_11">11</a>, <a href="ELS5_Section_12.htm#Section_12">12</a>,
- <a href="ELS5_Section_13.htm#Section_13">13</a> and <a href="ELS5_Section_14.htm#Section_14">14</a> is actually not a complete account of which
- token sequences are accepted as correct ECMAScript programs. Certain additional token sequences are also
- accepted, namely, those that would be described by the grammar if only semicolons were added to the
- sequence in certain places (such as before line terminator characters). Furthermore, certain token sequences
- that are described by the grammar are not considered acceptable if a terminator character appears in certain
- "awkward" places.
- <div class="copyright">© Ecma International 2009<b>8</b></div></div>
Add Comment
Please, Sign In to add comment