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
d4128f39
Kaydet (Commit)
d4128f39
authored
Haz 29, 2005
tarafından
Jack Jansen
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Added optional suppport for storage modifiers (virtual/static/inline/etc)
and conditional generation of objects and methods.
üst
b6216dd2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
2 deletions
+20
-2
bgenGenerator.py
Tools/bgen/bgen/bgenGenerator.py
+13
-2
bgenObjectDefinition.py
Tools/bgen/bgen/bgenObjectDefinition.py
+3
-0
scantools.py
Tools/bgen/bgen/scantools.py
+4
-0
No files found.
Tools/bgen/bgen/bgenGenerator.py
Dosyayı görüntüle @
d4128f39
...
...
@@ -15,18 +15,27 @@ INOUT = IN_OUT = "in-out"
class
BaseFunctionGenerator
:
def
__init__
(
self
,
name
,
condition
=
None
):
def
__init__
(
self
,
name
,
condition
=
None
,
callname
=
None
,
modifiers
=
None
):
if
DEBUG
:
print
"<--"
,
name
self
.
name
=
name
self
.
callname
=
name
if
callname
:
self
.
callname
=
callname
else
:
self
.
callname
=
name
self
.
prefix
=
name
self
.
objecttype
=
"PyObject"
# Type of _self argument to function
self
.
condition
=
condition
self
.
modifiers
=
modifiers
def
setprefix
(
self
,
prefix
):
self
.
prefix
=
prefix
def
checkgenerate
(
self
):
return
True
def
generate
(
self
):
if
not
self
.
checkgenerate
():
return
if
DEBUG
:
print
"-->"
,
self
.
name
if
self
.
condition
:
Output
()
...
...
@@ -51,6 +60,8 @@ class BaseFunctionGenerator:
OutRbrace
()
def
reference
(
self
,
name
=
None
):
if
not
self
.
checkgenerate
():
return
if
name
is
None
:
name
=
self
.
name
docstring
=
self
.
docstring
()
...
...
Tools/bgen/bgen/bgenObjectDefinition.py
Dosyayı görüntüle @
d4128f39
...
...
@@ -219,6 +219,9 @@ class ObjectDefinition(GeneratorGroup):
Output
(
"if (PyType_Ready(&
%
s) < 0) return;"
,
self
.
typename
)
Output
(
"""Py_INCREF(&
%
s);"""
,
self
.
typename
)
Output
(
"PyModule_AddObject(m,
\"
%
s
\"
, (PyObject *)&
%
s);"
,
self
.
name
,
self
.
typename
);
self
.
outputTypeObjectInitializerCompat
()
def
outputTypeObjectInitializerCompat
(
self
):
Output
(
"/* Backward-compatible name */"
)
Output
(
"""Py_INCREF(&
%
s);"""
,
self
.
typename
);
Output
(
"PyModule_AddObject(m,
\"
%
sType
\"
, (PyObject *)&
%
s);"
,
self
.
name
,
self
.
typename
);
...
...
Tools/bgen/bgen/scantools.py
Dosyayı görüntüle @
d4128f39
...
...
@@ -620,11 +620,15 @@ if missing: raise "Missing Types"
(
atype
,
aname
,
amode
))
if
self
.
greydictnames
.
has_key
(
name
):
self
.
specfile
.
write
(
" condition=
%
r,
\n
"
%
(
self
.
greydictnames
[
name
],))
self
.
generatemodifiers
(
classname
,
name
,
modifiers
)
self
.
specfile
.
write
(
")
\n
"
)
self
.
specfile
.
write
(
"
%
s.append(f)
\n\n
"
%
listname
)
def
destination
(
self
,
type
,
name
,
arglist
):
return
"FunctionGenerator"
,
"functions"
def
generatemodifiers
(
self
,
classname
,
name
,
modifiers
):
pass
def
blacklisted
(
self
,
type
,
name
):
if
type
in
self
.
blacklisttypes
:
...
...
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