]> granicus.if.org Git - docbook-dsssl/commitdiff
Python grammar
authorNorman Walsh <ndw@nwalsh.com>
Tue, 17 Sep 2002 21:21:24 +0000 (21:21 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Tue, 17 Sep 2002 21:21:24 +0000 (21:21 +0000)
testdocs/tests/productionset.006.xml [new file with mode: 0644]

diff --git a/testdocs/tests/productionset.006.xml b/testdocs/tests/productionset.006.xml
new file mode 100644 (file)
index 0000000..3198f8c
--- /dev/null
@@ -0,0 +1,809 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook EBNF Module V1.0//EN"
+                  "http://www.oasis-open.org/docbook/xml/ebnf/1.0/dbebnf.dtd">
+<article>
+<articleinfo>
+<title>Unit Test: productionset.006</title>
+<releaseinfo role="CVS">$Id$</releaseinfo>
+<author><firstname>Norman</firstname><surname>Walsh</surname>
+        <affiliation><address><email>ndw@nwalsh.com</email></address></affiliation>
+</author>
+</articleinfo>
+
+<productionset><title>Python Grammar<footnote>
+<para>Derived pseudo-mechanically from
+<ulink url="http://www.python.org/doc/current/ref/grammar.txt"/>.</para>
+</footnote></title>
+
+<production id="identifier">
+<lhs>identifier</lhs>
+<rhs>(<nonterminal def="#letter">letter</nonterminal>|"_") (<nonterminal def="#letter">letter</nonterminal>|<nonterminal def="#digit">digit</nonterminal>| "_")*</rhs>
+</production>
+
+<production id="letter">
+<lhs>letter</lhs>
+<rhs><nonterminal def="#lowercase">lowercase</nonterminal> <sbr/>| <nonterminal def="#uppercase">uppercase</nonterminal>
+</rhs>
+</production>
+
+<production id="lowercase">
+<lhs>lowercase</lhs>
+<rhs>"a"..."z"
+</rhs>
+</production>
+
+<production id="uppercase">
+<lhs>uppercase</lhs>
+<rhs>"A"..."Z"
+</rhs>
+</production>
+
+<production id="digit">
+<lhs>digit</lhs>
+<rhs>"0"..."9"
+</rhs>
+</production>
+
+<production id="stringliteral">
+<lhs>stringliteral</lhs>
+<rhs>[<nonterminal def="#stringprefix">stringprefix</nonterminal>](<nonterminal def="#shortstring">shortstring</nonterminal> | <nonterminal def="#longstring">longstring</nonterminal>)
+</rhs>
+</production>
+
+<production id="stringprefix">
+<lhs>stringprefix</lhs>
+<rhs>"r" | "u" | "ur" | "R" | "U" | "UR" | "Ur" | "uR"
+</rhs>
+</production>
+
+<production id="shortstring">
+<lhs>shortstring</lhs>
+<rhs>"'" <nonterminal def="#shortstringitem">shortstringitem</nonterminal>* "'" <sbr/>| '"' <nonterminal def="#shortstringitem">shortstringitem</nonterminal>* '"'
+</rhs>
+</production>
+
+<production id="longstring">
+<lhs>longstring</lhs>
+<rhs>"'''" <nonterminal def="#longstringitem">longstringitem</nonterminal>* "'''" <sbr/>| '"""' <nonterminal def="#longstringitem">longstringitem</nonterminal>* '"""'
+</rhs>
+</production>
+
+<production id="shortstringitem">
+<lhs>shortstringitem</lhs>
+<rhs><nonterminal def="#shortstringchar">shortstringchar</nonterminal> <sbr/>| <nonterminal def="#escapeseq">escapeseq</nonterminal>
+</rhs>
+</production>
+
+<production id="longstringitem">
+<lhs>longstringitem</lhs>
+<rhs><nonterminal def="#longstringchar">longstringchar</nonterminal> <sbr/>| <nonterminal def="#escapeseq">escapeseq</nonterminal>
+</rhs>
+</production>
+
+<production id="shortstringchar">
+<lhs>shortstringchar</lhs>
+<rhs>any ASCII character except "\" or newline or the quote
+</rhs>
+</production>
+
+<production id="longstringchar">
+<lhs>longstringchar</lhs>
+<rhs>any ASCII character except "\"
+</rhs>
+</production>
+
+<production id="escapeseq">
+<lhs>escapeseq</lhs>
+<rhs>"\" any ASCII character
+</rhs>
+</production>
+
+<production id="longinteger">
+<lhs>longinteger</lhs>
+<rhs><nonterminal def="#integer">integer</nonterminal> ("l" | "L")
+</rhs>
+</production>
+
+<production id="integer">
+<lhs>integer</lhs>
+<rhs><nonterminal def="#decimalinteger">decimalinteger</nonterminal> <sbr/>| <nonterminal def="#octinteger">octinteger</nonterminal> <sbr/>| <nonterminal def="#hexinteger">hexinteger</nonterminal>
+</rhs>
+</production>
+
+<production id="decimalinteger">
+<lhs>decimalinteger</lhs>
+<rhs><nonterminal def="#nonzerodigit">nonzerodigit</nonterminal> <nonterminal def="#digit">digit</nonterminal>* | "0"
+</rhs>
+</production>
+
+<production id="octinteger">
+<lhs>octinteger</lhs>
+<rhs>"0" <nonterminal def="#octdigit">octdigit</nonterminal>+
+</rhs>
+</production>
+
+<production id="hexinteger">
+<lhs>hexinteger</lhs>
+<rhs>"0" ("x" | "X") <nonterminal def="#hexdigit">hexdigit</nonterminal>+
+</rhs>
+</production>
+
+<production id="nonzerodigit">
+<lhs>nonzerodigit</lhs>
+<rhs>"1"..."9"
+</rhs>
+</production>
+
+<production id="octdigit">
+<lhs>octdigit</lhs>
+<rhs>"0"..."7"
+</rhs>
+</production>
+
+<production id="hexdigit">
+<lhs>hexdigit</lhs>
+<rhs><nonterminal def="#digit">digit</nonterminal> <sbr/>| "a"..."f" <sbr/>| "A"..."F"
+</rhs>
+</production>
+
+<production id="floatnumber">
+<lhs>floatnumber</lhs>
+<rhs><nonterminal def="#pointfloat">pointfloat</nonterminal> <sbr/>| <nonterminal def="#exponentfloat">exponentfloat</nonterminal>
+</rhs>
+</production>
+
+<production id="pointfloat">
+<lhs>pointfloat</lhs>
+<rhs>[<nonterminal def="#intpart">intpart</nonterminal>] <nonterminal def="#fraction">fraction</nonterminal> <sbr/>| <nonterminal def="#intpart">intpart</nonterminal> "."
+</rhs>
+</production>
+
+<production id="exponentfloat">
+<lhs>exponentfloat</lhs>
+<rhs>(<nonterminal def="#intpart">intpart</nonterminal> | <nonterminal def="#pointfloat">pointfloat</nonterminal>) <nonterminal def="#exponent">exponent</nonterminal>
+</rhs>
+</production>
+
+
+<production id="intpart">
+<lhs>intpart</lhs>
+<rhs><nonterminal def="#digit">digit</nonterminal>+
+</rhs>
+</production>
+
+<production id="fraction">
+<lhs>fraction</lhs>
+<rhs>"." <nonterminal def="#digit">digit</nonterminal>+
+</rhs>
+</production>
+
+<production id="exponent">
+<lhs>exponent</lhs>
+<rhs>("e" | "E") ["+" | "-"] <nonterminal def="#digit">digit</nonterminal>+
+</rhs>
+</production>
+
+<production id="imagnumber">
+<lhs>imagnumber</lhs>
+<rhs>(<nonterminal def="#floatnumber">floatnumber</nonterminal> <sbr/>| <nonterminal def="#intpart">intpart</nonterminal>) ("j" | "J")
+</rhs>
+</production>
+
+<production id="atom">
+<lhs>atom</lhs>
+<rhs><nonterminal def="#identifier">identifier</nonterminal> <sbr/>| <nonterminal def="#literal">literal</nonterminal> <sbr/>| <nonterminal def="#enclosure">enclosure</nonterminal>
+</rhs>
+</production>
+
+<production id="enclosure">
+<lhs>enclosure</lhs>
+<rhs><nonterminal def="#parenth_form">parenth_form</nonterminal> <sbr/>| <nonterminal def="#list_display">list_display</nonterminal> <sbr/>| <nonterminal def="#dict_display">dict_display</nonterminal> <sbr/>| <nonterminal def="#string_conversion">string_conversion</nonterminal>
+</rhs>
+</production>
+
+
+<production id="literal">
+<lhs>literal</lhs>
+<rhs><nonterminal def="#stringliteral">stringliteral</nonterminal> <sbr/>| <nonterminal def="#integer">integer</nonterminal> <sbr/>| <nonterminal def="#longinteger">longinteger</nonterminal> <sbr/>| <nonterminal def="#floatnumber">floatnumber</nonterminal> <sbr/>| <nonterminal def="#imagnumber">imagnumber</nonterminal>
+</rhs>
+</production>
+
+
+<production id="parenth_form">
+<lhs>parenth_form</lhs>
+<rhs>"(" [<nonterminal def="#expression_list">expression_list</nonterminal>] ")"
+</rhs>
+</production>
+
+<production id="list_display">
+<lhs>list_display</lhs>
+<rhs>"[" [<nonterminal def="#listmaker">listmaker</nonterminal>] "]"
+</rhs>
+</production>
+
+<production id="listmaker">
+<lhs>listmaker</lhs>
+<rhs><nonterminal def="#expression">expression</nonterminal> ( <nonterminal def="#list_for">list_for</nonterminal> | ( "," <nonterminal def="#expression">expression</nonterminal>)* [","] )
+</rhs>
+</production>
+
+
+<production id="list_iter">
+<lhs>list_iter</lhs>
+<rhs><nonterminal def="#list_for">list_for</nonterminal> <sbr/>| <nonterminal def="#list_if">list_if</nonterminal>
+</rhs>
+</production>
+
+<production id="list_for">
+<lhs>list_for</lhs>
+<rhs>"for" <nonterminal def="#expression_list">expression_list</nonterminal> "in" testlist [<nonterminal def="#list_iter">list_iter</nonterminal>]
+</rhs>
+</production>
+
+
+<production id="list_if">
+<lhs>list_if</lhs>
+<rhs>"if" test [<nonterminal def="#list_iter">list_iter</nonterminal>]
+</rhs>
+</production>
+
+<production id="dict_display">
+<lhs>dict_display</lhs>
+<rhs>"\{" [<nonterminal def="#key_datum_list">key_datum_list</nonterminal>] "\}"
+</rhs>
+</production>
+
+<production id="key_datum_list">
+<lhs>key_datum_list</lhs>
+<rhs><nonterminal def="#key_datum">key_datum</nonterminal> ("," <nonterminal def="#key_datum">key_datum</nonterminal>)* [","]
+</rhs>
+</production>
+
+<production id="key_datum">
+<lhs>key_datum</lhs>
+<rhs><nonterminal def="#expression">expression</nonterminal> ":" <nonterminal def="#expression">expression</nonterminal>
+</rhs>
+</production>
+
+<production id="string_conversion">
+<lhs>string_conversion</lhs>
+<rhs>"`" <nonterminal def="#expression_list">expression_list</nonterminal> "`"
+</rhs>
+</production>
+
+<production id="primary">
+<lhs>primary</lhs>
+<rhs><nonterminal def="#atom">atom</nonterminal> <sbr/>| <nonterminal def="#attributeref">attributeref</nonterminal> <sbr/>| <nonterminal def="#subscription">subscription</nonterminal> <sbr/>| <nonterminal def="#slicing">slicing</nonterminal> <sbr/>| <nonterminal def="#call">call</nonterminal>
+</rhs>
+</production>
+
+
+<production id="attributeref">
+<lhs>attributeref</lhs>
+<rhs><nonterminal def="#primary">primary</nonterminal> "." <nonterminal def="#identifier">identifier</nonterminal>
+</rhs>
+</production>
+
+<production id="subscription">
+<lhs>subscription</lhs>
+<rhs><nonterminal def="#primary">primary</nonterminal> "[" <nonterminal def="#expression_list">expression_list</nonterminal> "]"
+</rhs>
+</production>
+
+<production id="slicing">
+<lhs>slicing</lhs>
+<rhs><nonterminal def="#simple_slicing">simple_slicing</nonterminal> <sbr/>| <nonterminal def="#extended_slicing">extended_slicing</nonterminal>
+</rhs>
+</production>
+
+<production id="simple_slicing">
+<lhs>simple_slicing</lhs>
+<rhs><nonterminal def="#primary">primary</nonterminal> "[" <nonterminal def="#short_slice">short_slice</nonterminal> "]"
+</rhs>
+</production>
+
+<production id="extended_slicing">
+<lhs>extended_slicing</lhs>
+<rhs><nonterminal def="#primary">primary</nonterminal> "[" <nonterminal def="#slice_list">slice_list</nonterminal> "]"
+</rhs>
+</production>
+
+<production id="slice_list">
+<lhs>slice_list</lhs>
+<rhs><nonterminal def="#slice_item">slice_item</nonterminal> ("," <nonterminal def="#slice_item">slice_item</nonterminal>)* [","]
+</rhs>
+</production>
+
+<production id="slice_item">
+<lhs>slice_item</lhs>
+<rhs><nonterminal def="#expression">expression</nonterminal> <sbr/>| <nonterminal def="#proper_slice">proper_slice</nonterminal> <sbr/>| <nonterminal def="#ellipsis">ellipsis</nonterminal>
+</rhs>
+</production>
+
+<production id="proper_slice">
+<lhs>proper_slice</lhs>
+<rhs><nonterminal def="#short_slice">short_slice</nonterminal> <sbr/>| <nonterminal def="#long_slice">long_slice</nonterminal>
+</rhs>
+</production>
+
+<production id="short_slice">
+<lhs>short_slice</lhs>
+<rhs>[<nonterminal def="#lower_bound">lower_bound</nonterminal>] ":" [<nonterminal def="#upper_bound">upper_bound</nonterminal>]
+</rhs>
+</production>
+
+<production id="long_slice">
+<lhs>long_slice</lhs>
+<rhs><nonterminal def="#short_slice">short_slice</nonterminal> ":" [<nonterminal def="#stride">stride</nonterminal>]
+</rhs>
+</production>
+
+<production id="lower_bound">
+<lhs>lower_bound</lhs>
+<rhs><nonterminal def="#expression">expression</nonterminal>
+</rhs>
+</production>
+
+<production id="upper_bound">
+<lhs>upper_bound</lhs>
+<rhs><nonterminal def="#expression">expression</nonterminal>
+</rhs>
+</production>
+
+<production id="stride">
+<lhs>stride</lhs>
+<rhs><nonterminal def="#expression">expression</nonterminal>
+</rhs>
+</production>
+
+<production id="ellipsis">
+<lhs>ellipsis</lhs>
+<rhs>"..."
+</rhs>
+</production>
+
+<production id="call">
+<lhs>call</lhs>
+<rhs><nonterminal def="#primary">primary</nonterminal> "(" [<nonterminal def="#argument_list">argument_list</nonterminal> [","]] ")"
+</rhs>
+</production>
+
+<production id="argument_list">
+<lhs>argument_list</lhs>
+<rhs><nonterminal def="#positional_arguments">positional_arguments</nonterminal> ["," <nonterminal def="#keyword_arguments">keyword_arguments</nonterminal>
+                   ["," "*" <nonterminal def="#expression">expression</nonterminal> ["," "**" <nonterminal def="#expression">expression</nonterminal>]]]
+                <sbr/>| <nonterminal def="#keyword_arguments">keyword_arguments</nonterminal> ["," "*" <nonterminal def="#expression">expression</nonterminal>
+                                             ["," "**" <nonterminal def="#expression">expression</nonterminal>]]
+                <sbr/>| "*" <nonterminal def="#expression">expression</nonterminal> ["," "**" <nonterminal def="#expression">expression</nonterminal>]
+                <sbr/>| "**" <nonterminal def="#expression">expression</nonterminal></rhs>
+</production>
+
+<production id="positional_arguments">
+<lhs>positional_arguments</lhs>
+<rhs><nonterminal def="#expression">expression</nonterminal> ("," <nonterminal def="#expression">expression</nonterminal>)*
+</rhs>
+</production>
+
+<production id="keyword_arguments">
+<lhs>keyword_arguments</lhs>
+<rhs><nonterminal def="#keyword_item">keyword_item</nonterminal> ("," <nonterminal def="#keyword_item">keyword_item</nonterminal>)*
+</rhs>
+</production>
+
+<production id="keyword_item">
+<lhs>keyword_item</lhs>
+<rhs><nonterminal def="#identifier">identifier</nonterminal> "=" <nonterminal def="#expression">expression</nonterminal>
+</rhs>
+</production>
+
+<production id="power">
+<lhs>power</lhs>
+<rhs><nonterminal def="#primary">primary</nonterminal> ["**" <nonterminal def="#u_expr">u_expr</nonterminal>]
+</rhs>
+</production>
+
+<production id="u_expr">
+<lhs>u_expr</lhs>
+<rhs><nonterminal def="#power">power</nonterminal> <sbr/>| "-" <nonterminal def="#u_expr">u_expr</nonterminal> <sbr/>| "+" <nonterminal def="#u_expr">u_expr</nonterminal> <sbr/>| "\~" <nonterminal def="#u_expr">u_expr</nonterminal>
+</rhs>
+</production>
+
+
+<production id="m_expr">
+<lhs>m_expr</lhs>
+<rhs><nonterminal def="#u_expr">u_expr</nonterminal> <sbr/>| <nonterminal def="#m_expr">m_expr</nonterminal> "*" <nonterminal def="#u_expr">u_expr</nonterminal> <sbr/>| <nonterminal def="#m_expr">m_expr</nonterminal> "/" <nonterminal def="#u_expr">u_expr</nonterminal> <sbr/>| <nonterminal def="#m_expr">m_expr</nonterminal> "\%" <nonterminal def="#u_expr">u_expr</nonterminal>
+</rhs>
+</production>
+
+
+
+<production id="a_expr">
+<lhs>a_expr</lhs>
+<rhs><nonterminal def="#m_expr">m_expr</nonterminal> <sbr/>| aexpr "+" <nonterminal def="#m_expr">m_expr</nonterminal> aexpr "-" <nonterminal def="#m_expr">m_expr</nonterminal>
+</rhs>
+</production>
+
+
+<production id="shift_expr">
+<lhs>shift_expr</lhs>
+<rhs><nonterminal def="#a_expr">a_expr</nonterminal> <sbr/>| <nonterminal def="#shift_expr">shift_expr</nonterminal> ( "&lt;&lt;" | "&gt;&gt;" ) <nonterminal def="#a_expr">a_expr</nonterminal>
+</rhs>
+</production>
+
+
+<production id="and_expr">
+<lhs>and_expr</lhs>
+<rhs><nonterminal def="#shift_expr">shift_expr</nonterminal> <sbr/>| <nonterminal def="#and_expr">and_expr</nonterminal> "&amp;" <nonterminal def="#shift_expr">shift_expr</nonterminal>
+</rhs>
+</production>
+
+<production id="xor_expr">
+<lhs>xor_expr</lhs>
+<rhs><nonterminal def="#and_expr">and_expr</nonterminal> <sbr/>| <nonterminal def="#xor_expr">xor_expr</nonterminal> "^" <nonterminal def="#and_expr">and_expr</nonterminal>
+</rhs>
+</production>
+
+<production id="or_expr">
+<lhs>or_expr</lhs>
+<rhs><nonterminal def="#xor_expr">xor_expr</nonterminal> <sbr/>| <nonterminal def="#or_expr">or_expr</nonterminal> "|" <nonterminal def="#xor_expr">xor_expr</nonterminal>
+</rhs>
+</production>
+
+<production id="comparison">
+<lhs>comparison</lhs>
+<rhs><nonterminal def="#or_expr">or_expr</nonterminal> ( <nonterminal def="#comp_operator">comp_operator</nonterminal> <nonterminal def="#or_expr">or_expr</nonterminal> )*
+</rhs>
+</production>
+
+<production id="comp_operator">
+<lhs>comp_operator</lhs>
+<rhs>"&lt;" <sbr/>| "&gt;" <sbr/>| "==" <sbr/>| "&gt;=" <sbr/>| "&lt;=" <sbr/>| "&lt;&gt;" <sbr/>| "!=" <sbr/>| "is" ["not"] <sbr/>| ["not"] "in"
+</rhs>
+</production>
+
+
+<production id="expression">
+<lhs>expression</lhs>
+<rhs><nonterminal def="#or_test">or_test</nonterminal> <sbr/>| <nonterminal def="#lambda_form">lambda_form</nonterminal>
+</rhs>
+</production>
+
+<production id="or_test">
+<lhs>or_test</lhs>
+<rhs><nonterminal def="#and_test">and_test</nonterminal> <sbr/>| <nonterminal def="#or_test">or_test</nonterminal> "or" <nonterminal def="#and_test">and_test</nonterminal>
+</rhs>
+</production>
+
+<production id="and_test">
+<lhs>and_test</lhs>
+<rhs><nonterminal def="#not_test">not_test</nonterminal> <sbr/>| <nonterminal def="#and_test">and_test</nonterminal> "and" <nonterminal def="#not_test">not_test</nonterminal>
+</rhs>
+</production>
+
+<production id="not_test">
+<lhs>not_test</lhs>
+<rhs><nonterminal def="#comparison">comparison</nonterminal> <sbr/>| "not" <nonterminal def="#not_test">not_test</nonterminal>
+</rhs>
+</production>
+
+<production id="lambda_form">
+<lhs>lambda_form</lhs>
+<rhs>"lambda" [<nonterminal def="#parameter_list">parameter_list</nonterminal>]: <nonterminal def="#expression">expression</nonterminal>
+</rhs>
+</production>
+
+<production id="expression_list">
+<lhs>expression_list</lhs>
+<rhs><nonterminal def="#expression">expression</nonterminal> ( "," <nonterminal def="#expression">expression</nonterminal> )* [","]
+</rhs>
+</production>
+
+<production id="simple_stmt">
+<lhs>simple_stmt</lhs>
+<rhs><nonterminal def="#expression_stmt">expression_stmt</nonterminal>
+<sbr/>| <nonterminal def="#assert_stmt">assert_stmt</nonterminal>
+<sbr/>| <nonterminal def="#assignment_stmt">assignment_stmt</nonterminal>
+<sbr/>| <nonterminal def="#augmented_assignment_stmt">augmented_assignment_stmt</nonterminal>
+<sbr/>| <nonterminal def="#pass_stmt">pass_stmt</nonterminal>
+<sbr/>| <nonterminal def="#del_stmt">del_stmt</nonterminal>
+<sbr/>| <nonterminal def="#print_stmt">print_stmt</nonterminal>
+<sbr/>| <nonterminal def="#return_stmt">return_stmt</nonterminal>
+<sbr/>| <nonterminal def="#yield_stmt">yield_stmt</nonterminal>
+<sbr/>| <nonterminal def="#raise_stmt">raise_stmt</nonterminal>
+<sbr/>| <nonterminal def="#break_stmt">break_stmt</nonterminal>
+<sbr/>| <nonterminal def="#continue_stmt">continue_stmt</nonterminal>
+<sbr/>| <nonterminal def="#import_stmt">import_stmt</nonterminal>
+<sbr/>| <nonterminal def="#global_stmt">global_stmt</nonterminal>
+<sbr/>| <nonterminal def="#exec_stmt">exec_stmt</nonterminal>
+</rhs>
+</production>
+
+<production id="expression_stmt">
+<lhs>expression_stmt</lhs>
+<rhs><nonterminal def="#expression_list">expression_list</nonterminal>
+</rhs>
+</production>
+
+<production id="assert_stmt">
+<lhs>assert_stmt</lhs>
+<rhs>"assert" <nonterminal def="#expression">expression</nonterminal> ["," <nonterminal def="#expression">expression</nonterminal>]
+</rhs>
+</production>
+
+<production id="assignment_stmt">
+<lhs>assignment_stmt</lhs>
+<rhs>(<nonterminal def="#target_list">target_list</nonterminal> "=")+ <nonterminal def="#expression_list">expression_list</nonterminal>
+</rhs>
+</production>
+
+<production id="target_list">
+<lhs>target_list</lhs>
+<rhs><nonterminal def="#target">target</nonterminal> ("," <nonterminal def="#target">target</nonterminal>)* [","]
+</rhs>
+</production>
+
+<production id="target">
+<lhs>target</lhs>
+<rhs><nonterminal def="#identifier">identifier</nonterminal>
+<sbr/>| "(" <nonterminal def="#target_list">target_list</nonterminal> ")"
+<sbr/>| "[" <nonterminal def="#target_list">target_list</nonterminal> "]"
+<sbr/>| <nonterminal def="#attributeref">attributeref</nonterminal>
+<sbr/>| <nonterminal def="#subscription">subscription</nonterminal>
+<sbr/>| <nonterminal def="#slicing">slicing</nonterminal>
+</rhs>
+</production>
+
+<production id="augmented_assignment_stmt">
+<lhs>augmented_assignment_stmt</lhs>
+<rhs><nonterminal def="#target">target</nonterminal> <nonterminal def="#augop">augop</nonterminal> <nonterminal def="#expression_list">expression_list</nonterminal>
+</rhs>
+</production>
+
+<production id="augop">
+<lhs>augop</lhs>
+<rhs>"+=" <sbr/>| "-=" <sbr/>| "*=" <sbr/>| "/=" <sbr/>| "\%=" <sbr/>| "**=" <sbr/>| "&gt;&gt;=" <sbr/>| "&lt;&lt;=" <sbr/>| "\&amp;=" <sbr/>| "\textasciicircum=" <sbr/>| "|="
+</rhs>
+</production>
+
+
+<production id="pass_stmt">
+<lhs>pass_stmt</lhs>
+<rhs>"pass"
+</rhs>
+</production>
+
+<production id="del_stmt">
+<lhs>del_stmt</lhs>
+<rhs>"del" <nonterminal def="#target_list">target_list</nonterminal>
+</rhs>
+</production>
+
+<production id="print_stmt">
+<lhs>print_stmt</lhs>
+<rhs>"print" ( \optionalexpression ("," <nonterminal def="#expression">expression</nonterminal>)* \optional","
+                | "&gt;\code&gt;" <nonterminal def="#expression">expression</nonterminal>
+                  \optional("," <nonterminal def="#expression">expression</nonterminal>)+ \optional"," )
+</rhs>
+</production>
+
+<production id="return_stmt">
+<lhs>return_stmt</lhs>
+<rhs>"return" [<nonterminal def="#expression_list">expression_list</nonterminal>]
+</rhs>
+</production>
+
+<production id="yield_stmt">
+<lhs>yield_stmt</lhs>
+<rhs>"yield" <nonterminal def="#expression_list">expression_list</nonterminal>
+</rhs>
+</production>
+
+<production id="raise_stmt">
+<lhs>raise_stmt</lhs>
+<rhs>"raise" [<nonterminal def="#expression">expression</nonterminal> ["," <nonterminal def="#expression">expression</nonterminal> ["," <nonterminal def="#expression">expression</nonterminal>]]]
+</rhs>
+</production>
+
+
+<production id="break_stmt">
+<lhs>break_stmt</lhs>
+<rhs>"break"
+</rhs>
+</production>
+
+<production id="continue_stmt">
+<lhs>continue_stmt</lhs>
+<rhs>"continue"
+</rhs>
+</production>
+
+<production id="import_stmt">
+<lhs>import_stmt</lhs>
+<rhs>"import" <nonterminal def="#module">module</nonterminal> ["as" name]
+( "," <nonterminal def="#module">module</nonterminal> ["as" name] )*
+<sbr/>| "from" <nonterminal def="#module">module</nonterminal> "import" <nonterminal def="#identifier">identifier</nonterminal>
+    ["as" name]
+  ( "," <nonterminal def="#identifier">identifier</nonterminal> ["as" name] )*
+<sbr/>| "from" <nonterminal def="#module">module</nonterminal> "import" "*"
+</rhs>
+</production>
+
+<production id="module">
+<lhs>module</lhs>
+<rhs>(<nonterminal def="#identifier">identifier</nonterminal> ".")* <nonterminal def="#identifier">identifier</nonterminal>
+</rhs>
+</production>
+
+<production id="global_stmt">
+<lhs>global_stmt</lhs>
+<rhs>"global" <nonterminal def="#identifier">identifier</nonterminal> ("," <nonterminal def="#identifier">identifier</nonterminal>)*
+</rhs>
+</production>
+
+<production id="exec_stmt">
+<lhs>exec_stmt</lhs>
+<rhs>"exec" <nonterminal def="#expression">expression</nonterminal> ["in" <nonterminal def="#expression">expression</nonterminal> ["," <nonterminal def="#expression">expression</nonterminal>]]
+</rhs>
+</production>
+
+
+<production id="compound_stmt">
+<lhs>compound_stmt</lhs>
+<rhs><nonterminal def="#if_stmt">if_stmt</nonterminal>
+<sbr/>| <nonterminal def="#while_stmt">while_stmt</nonterminal>
+<sbr/>| <nonterminal def="#for_stmt">for_stmt</nonterminal>
+<sbr/>| <nonterminal def="#try_stmt">try_stmt</nonterminal>
+<sbr/>| <nonterminal def="#funcdef">funcdef</nonterminal>
+<sbr/>| <nonterminal def="#classdef">classdef</nonterminal>
+</rhs>
+</production>
+
+
+<production id="suite">
+<lhs>suite</lhs>
+<rhs><nonterminal def="#stmt_list">stmt_list</nonterminal> NEWLINE <sbr/>| NEWLINE INDENT <nonterminal def="#statement">statement</nonterminal>+ DEDENT
+</rhs>
+</production>
+
+
+<production id="statement">
+<lhs>statement</lhs>
+<rhs><nonterminal def="#stmt_list">stmt_list</nonterminal> NEWLINE <sbr/>| <nonterminal def="#compound_stmt">compound_stmt</nonterminal>
+</rhs>
+</production>
+
+<production id="stmt_list">
+<lhs>stmt_list</lhs>
+<rhs><nonterminal def="#simple_stmt">simple_stmt</nonterminal> (";" <nonterminal def="#simple_stmt">simple_stmt</nonterminal>)* [";"]
+</rhs>
+</production>
+
+<production id="if_stmt">
+<lhs>if_stmt</lhs>
+<rhs>"if" <nonterminal def="#expression">expression</nonterminal> ":" <nonterminal def="#suite">suite</nonterminal>
+( "elif" <nonterminal def="#expression">expression</nonterminal> ":" <nonterminal def="#suite">suite</nonterminal> )*
+["else" ":" <nonterminal def="#suite">suite</nonterminal>]
+</rhs>
+</production>
+
+<production id="while_stmt">
+<lhs>while_stmt</lhs>
+<rhs>"while" <nonterminal def="#expression">expression</nonterminal> ":" <nonterminal def="#suite">suite</nonterminal> ["else" ":" <nonterminal def="#suite">suite</nonterminal>]
+</rhs>
+</production>
+
+
+<production id="for_stmt">
+<lhs>for_stmt</lhs>
+<rhs>"for" <nonterminal def="#target_list">target_list</nonterminal> "in" <nonterminal def="#expression_list">expression_list</nonterminal> ":" <nonterminal def="#suite">suite</nonterminal> ["else" ":" <nonterminal def="#suite">suite</nonterminal>]
+</rhs>
+</production>
+
+
+
+<production id="try_stmt">
+<lhs>try_stmt</lhs>
+<rhs><nonterminal def="#try_exc_stmt">try_exc_stmt</nonterminal> <sbr/>| <nonterminal def="#try_fin_stmt">try_fin_stmt</nonterminal>
+</rhs>
+</production>
+
+<production id="try_exc_stmt">
+<lhs>try_exc_stmt</lhs>
+<rhs>"try" ":" <nonterminal def="#suite">suite</nonterminal>
+                ("except" [<nonterminal def="#expression">expression</nonterminal>
+                             ["," <nonterminal def="#target">target</nonterminal>]] ":" <nonterminal def="#suite">suite</nonterminal>)+
+                ["else" ":" <nonterminal def="#suite">suite</nonterminal>]
+</rhs>
+</production>
+
+<production id="try_fin_stmt">
+<lhs>try_fin_stmt</lhs>
+<rhs>"try" ":" <nonterminal def="#suite">suite</nonterminal> "finally" ":" <nonterminal def="#suite">suite</nonterminal>
+</rhs>
+</production>
+
+<production id="funcdef">
+<lhs>funcdef</lhs>
+<rhs>"def" <nonterminal def="#funcname">funcname</nonterminal> "(" [<nonterminal def="#parameter_list">parameter_list</nonterminal>] ")" ":" <nonterminal def="#suite">suite</nonterminal>
+</rhs>
+</production>
+
+<production id="parameter_list">
+<lhs>parameter_list</lhs>
+<rhs>(<nonterminal def="#defparameter">defparameter</nonterminal> ",")*
+("*" <nonterminal def="#identifier">identifier</nonterminal> [, "**" <nonterminal def="#identifier">identifier</nonterminal>]
+<sbr/>| "**" <nonterminal def="#identifier">identifier</nonterminal>
+  <sbr/>| <nonterminal def="#defparameter">defparameter</nonterminal> [","])
+</rhs>
+</production>
+
+<production id="defparameter">
+<lhs>defparameter</lhs>
+<rhs><nonterminal def="#parameter">parameter</nonterminal> ["=" <nonterminal def="#expression">expression</nonterminal>]
+</rhs>
+</production>
+
+<production id="sublist">
+<lhs>sublist</lhs>
+<rhs><nonterminal def="#parameter">parameter</nonterminal> ("," <nonterminal def="#parameter">parameter</nonterminal>)* [","]
+</rhs>
+</production>
+
+<production id="parameter">
+<lhs>parameter</lhs>
+<rhs><nonterminal def="#identifier">identifier</nonterminal> | "(" <nonterminal def="#sublist">sublist</nonterminal> ")"
+</rhs>
+</production>
+
+<production id="funcname">
+<lhs>funcname</lhs>
+<rhs><nonterminal def="#identifier">identifier</nonterminal>
+</rhs>
+</production>
+
+<production id="classdef">
+<lhs>classdef</lhs>
+<rhs>"class" <nonterminal def="#classname">classname</nonterminal> [<nonterminal def="#inheritance">inheritance</nonterminal>] ":" <nonterminal def="#suite">suite</nonterminal>
+</rhs>
+</production>
+
+
+<production id="inheritance">
+<lhs>inheritance</lhs>
+<rhs>"(" [<nonterminal def="#expression_list">expression_list</nonterminal>] ")"
+</rhs>
+</production>
+
+<production id="classname">
+<lhs>classname</lhs>
+<rhs><nonterminal def="#identifier">identifier</nonterminal>
+</rhs>
+</production>
+
+<production id="file_input">
+<lhs>file_input</lhs>
+<rhs>(NEWLINE | <nonterminal def="#statement">statement</nonterminal>)*
+</rhs>
+</production>
+
+<production id="interactive_input">
+<lhs>interactive_input</lhs>
+<rhs>[<nonterminal def="#stmt_list">stmt_list</nonterminal>] NEWLINE | <nonterminal def="#compound_stmt">compound_stmt</nonterminal> NEWLINE
+</rhs>
+</production>
+
+<production id="eval_input">
+<lhs>eval_input</lhs>
+<rhs><nonterminal def="#expression_list">expression_list</nonterminal> NEWLINE*
+</rhs>
+</production>
+
+<production id="input_input">
+<lhs>input_input</lhs>
+<rhs><nonterminal def="#expression_list">expression_list</nonterminal> NEWLINE
+</rhs>
+</production>
+
+</productionset>
+
+</article>