Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
e061a51d
Kaydet (Commit)
e061a51d
authored
Eki 06, 1997
tarafından
Fred Drake
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Minor nits (Lib/token.py is a file, token is a module...).
Added docs for symbol and token modules at the end.
üst
db12f343
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
104 additions
and
4 deletions
+104
-4
libparser.tex
Doc/lib/libparser.tex
+52
-2
libparser.tex
Doc/libparser.tex
+52
-2
No files found.
Doc/lib/libparser.tex
Dosyayı görüntüle @
e061a51d
...
@@ -53,7 +53,7 @@ non-terminal elements in the grammar always have a length greater than
...
@@ -53,7 +53,7 @@ non-terminal elements in the grammar always have a length greater than
one. The first element is an integer which identifies a production in
one. The first element is an integer which identifies a production in
the grammar. These integers are given symbolic names in the C header
the grammar. These integers are given symbolic names in the C header
file
\file
{
Include/graminit.h
}
and the Python module
file
\file
{
Include/graminit.h
}
and the Python module
\
file
{
Lib/symbol.py
}
. Each additional element of the sequence represents
\
code
{
symbol
}
. Each additional element of the sequence represents
a component of the production as recognized in the input string: these
a component of the production as recognized in the input string: these
are always sequences which have the same form as the parent. An
are always sequences which have the same form as the parent. An
important aspect of this structure which should be noted is that
important aspect of this structure which should be noted is that
...
@@ -72,7 +72,7 @@ any child elements and the addition of the source text which was
...
@@ -72,7 +72,7 @@ any child elements and the addition of the source text which was
identified. The example of the
\code
{
if
}
keyword above is
identified. The example of the
\code
{
if
}
keyword above is
representative. The various types of terminal symbols are defined in
representative. The various types of terminal symbols are defined in
the C header file
\file
{
Include/token.h
}
and the Python module
the C header file
\file
{
Include/token.h
}
and the Python module
\
file
{
Lib/token.py
}
.
\
code
{
token
}
.
The AST objects are not required to support the functionality of this
The AST objects are not required to support the functionality of this
module, but are provided for three purposes: to allow an application
module, but are provided for three purposes: to allow an application
...
@@ -677,5 +677,55 @@ of this example, the code may be extended at clearly defined points to
...
@@ -677,5 +677,55 @@ of this example, the code may be extended at clearly defined points to
provide additional capabilities.
provide additional capabilities.
\section
{
Standard Module
\sectcode
{
symbol
}}
\stmodindex
{
symbol
}
This module provides constants which represent the numeric values of
internal nodes of the parse tree. Unlike most Python constants, these
use lower-case names. Refer to the file
\file
{
Grammar/Grammar
}
in the
Python distribution for the defintions of the names in the context of
the language grammar. The specific numeric values which the names map
to may change between Python versions.
This module also provides one additional data object:
\begin{datadesc}
{
sym
_
name
}
Dictionary mapping the numeric values of the constants defined in this
module back to name strings, allowing more human-readable
representation of parse trees to be generated.
\end{datadesc}
\section
{
Standard Module
\sectcode
{
token
}}
\stmodindex
{
token
}
This module provides constants which represent the numeric values of
leaf nodes of the parse tree (terminal tokens). Refer to the file
\file
{
Grammar/Grammar
}
in the Python distribution for the defintions
of the names in the context of the language grammar. The specific
numeric values which the names map to may change between Python
versions.
This module also provides one data object and some functions. The
functions mirror definitions in the Python C header files.
\begin{datadesc}
{
tok
_
name
}
Dictionary mapping the numeric values of the constants defined in this
module back to name strings, allowing more human-readable
representation of parse trees to be generated.
\end{datadesc}
\begin{funcdesc}
{
ISTERMINAL
}{
x
}
Return true for terminal token values.
\end{funcdesc}
\begin{funcdesc}
{
ISNONTERMINAL
}{
x
}
Return true for non-terminal token values.
\end{funcdesc}
\begin{funcdesc}
{
ISEOF
}{
x
}
Return true if
\var
{
x
}
is the marker indicating the end of input.
\end{funcdesc}
%%
%%
%% end of file
%% end of file
Doc/libparser.tex
Dosyayı görüntüle @
e061a51d
...
@@ -53,7 +53,7 @@ non-terminal elements in the grammar always have a length greater than
...
@@ -53,7 +53,7 @@ non-terminal elements in the grammar always have a length greater than
one. The first element is an integer which identifies a production in
one. The first element is an integer which identifies a production in
the grammar. These integers are given symbolic names in the C header
the grammar. These integers are given symbolic names in the C header
file
\file
{
Include/graminit.h
}
and the Python module
file
\file
{
Include/graminit.h
}
and the Python module
\
file
{
Lib/symbol.py
}
. Each additional element of the sequence represents
\
code
{
symbol
}
. Each additional element of the sequence represents
a component of the production as recognized in the input string: these
a component of the production as recognized in the input string: these
are always sequences which have the same form as the parent. An
are always sequences which have the same form as the parent. An
important aspect of this structure which should be noted is that
important aspect of this structure which should be noted is that
...
@@ -72,7 +72,7 @@ any child elements and the addition of the source text which was
...
@@ -72,7 +72,7 @@ any child elements and the addition of the source text which was
identified. The example of the
\code
{
if
}
keyword above is
identified. The example of the
\code
{
if
}
keyword above is
representative. The various types of terminal symbols are defined in
representative. The various types of terminal symbols are defined in
the C header file
\file
{
Include/token.h
}
and the Python module
the C header file
\file
{
Include/token.h
}
and the Python module
\
file
{
Lib/token.py
}
.
\
code
{
token
}
.
The AST objects are not required to support the functionality of this
The AST objects are not required to support the functionality of this
module, but are provided for three purposes: to allow an application
module, but are provided for three purposes: to allow an application
...
@@ -677,5 +677,55 @@ of this example, the code may be extended at clearly defined points to
...
@@ -677,5 +677,55 @@ of this example, the code may be extended at clearly defined points to
provide additional capabilities.
provide additional capabilities.
\section
{
Standard Module
\sectcode
{
symbol
}}
\stmodindex
{
symbol
}
This module provides constants which represent the numeric values of
internal nodes of the parse tree. Unlike most Python constants, these
use lower-case names. Refer to the file
\file
{
Grammar/Grammar
}
in the
Python distribution for the defintions of the names in the context of
the language grammar. The specific numeric values which the names map
to may change between Python versions.
This module also provides one additional data object:
\begin{datadesc}
{
sym
_
name
}
Dictionary mapping the numeric values of the constants defined in this
module back to name strings, allowing more human-readable
representation of parse trees to be generated.
\end{datadesc}
\section
{
Standard Module
\sectcode
{
token
}}
\stmodindex
{
token
}
This module provides constants which represent the numeric values of
leaf nodes of the parse tree (terminal tokens). Refer to the file
\file
{
Grammar/Grammar
}
in the Python distribution for the defintions
of the names in the context of the language grammar. The specific
numeric values which the names map to may change between Python
versions.
This module also provides one data object and some functions. The
functions mirror definitions in the Python C header files.
\begin{datadesc}
{
tok
_
name
}
Dictionary mapping the numeric values of the constants defined in this
module back to name strings, allowing more human-readable
representation of parse trees to be generated.
\end{datadesc}
\begin{funcdesc}
{
ISTERMINAL
}{
x
}
Return true for terminal token values.
\end{funcdesc}
\begin{funcdesc}
{
ISNONTERMINAL
}{
x
}
Return true for non-terminal token values.
\end{funcdesc}
\begin{funcdesc}
{
ISEOF
}{
x
}
Return true if
\var
{
x
}
is the marker indicating the end of input.
\end{funcdesc}
%%
%%
%% end of file
%% end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment