summaryrefslogtreecommitdiffstats
path: root/Doc/ref/ref8.tex
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2001-07-06 22:49:53 (GMT)
committerFred Drake <fdrake@acm.org>2001-07-06 22:49:53 (GMT)
commitcb4638a278a205536f558263d5c52ca51613f80b (patch)
tree6788128b1099b81d20ac93344229a13d83b88cff /Doc/ref/ref8.tex
parentb2d1006272453566e3283bb277adeb74c6cbd43c (diff)
downloadcpython-cb4638a278a205536f558263d5c52ca51613f80b.zip
cpython-cb4638a278a205536f558263d5c52ca51613f80b.tar.gz
cpython-cb4638a278a205536f558263d5c52ca51613f80b.tar.bz2
Change the grammar productions to use the new productionlist environment;
this supports a hyperlinked version of the grammar that can make tracking down details and definitions a little easier.
Diffstat (limited to 'Doc/ref/ref8.tex')
-rw-r--r--Doc/ref/ref8.tex28
1 files changed, 16 insertions, 12 deletions
diff --git a/Doc/ref/ref8.tex b/Doc/ref/ref8.tex
index 24d10b1..d10c87f 100644
--- a/Doc/ref/ref8.tex
+++ b/Doc/ref/ref8.tex
@@ -49,9 +49,10 @@ program.
All input read from non-interactive files has the same form:
-\begin{verbatim}
-file_input: (NEWLINE | statement)*
-\end{verbatim}
+\begin{productionlist}
+ \production{file_input}
+ {(NEWLINE | \token{statement})*}
+\end{productionlist}
This syntax is used in the following situations:
@@ -70,9 +71,10 @@ This syntax is used in the following situations:
Input in interactive mode is parsed using the following grammar:
-\begin{verbatim}
-interactive_input: [stmt_list] NEWLINE | compound_stmt NEWLINE
-\end{verbatim}
+\begin{productionlist}
+ \production{interactive_input}
+ {[\token{stmt_list}] NEWLINE | \token{compound_stmt} NEWLINE}
+\end{productionlist}
Note that a (top-level) compound statement must be followed by a blank
line in interactive mode; this is needed to help the parser detect the
@@ -87,16 +89,18 @@ whitespace.
The string argument to \function{eval()} must have the following form:
\bifuncindex{eval}
-\begin{verbatim}
-eval_input: expression_list NEWLINE*
-\end{verbatim}
+\begin{productionlist}
+ \production{eval_input}
+ {\token{expression_list} NEWLINE*}
+\end{productionlist}
The input line read by \function{input()} must have the following form:
\bifuncindex{input}
-\begin{verbatim}
-input_input: expression_list NEWLINE
-\end{verbatim}
+\begin{productionlist}
+ \production{input_input}
+ {\token{expression_list} NEWLINE}
+\end{productionlist}
Note: to read `raw' input line without interpretation, you can use the
built-in function \function{raw_input()} or the \method{readline()} method