Guest User

Untitled

a guest
Apr 20th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.06 KB | None | 0 0
  1.  
  2. <h3 id="Section_5.1.4">5.1.4 &nbsp; The Syntactic Grammar</h3>
  3.  
  4. 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>,
  5.  
  6. <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
  7.  
  8. 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
  9.  
  10. from the goal symbol <i>Program</i>, that describe how sequences of tokens can form syntactically correct
  11.  
  12. ECMAScript programs.
  13.  
  14. <br><br>
  15.  
  16. When a stream of characters is to be parsed as an ECMAScript program, it is first converted to a stream of
  17.  
  18. input elements by repeated application of the lexical grammar; this stream of input elements is then parsed by
  19.  
  20. a single application of the syntactic grammar. The program is syntactically in error if the tokens in the stream
  21.  
  22. of input elements cannot be parsed as a single instance of the goal nonterminal <i>Program</i>, with no tokens left
  23.  
  24. over.
  25.  
  26. <br><br>
  27.  
  28. Productions of the syntactic grammar are distinguished by having just one colon "<b>:</b>" as punctuation.
  29.  
  30. <br><br>
  31.  
  32. 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>,
  33.  
  34. <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
  35.  
  36. token sequences are accepted as correct ECMAScript programs. Certain additional token sequences are also
  37.  
  38. accepted, namely, those that would be described by the grammar if only semicolons were added to the
  39.  
  40. sequence in certain places (such as before line terminator characters). Furthermore, certain token sequences
  41.  
  42. that are described by the grammar are not considered acceptable if a terminator character appears in certain
  43.  
  44. "awkward" places.
  45.  
  46. <div class="copyright">© Ecma International 2009<b>8</b></div></div>
Add Comment
Please, Sign In to add comment