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
fd8a3930
Kaydet (Commit)
fd8a3930
authored
Ara 02, 1996
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Make gcc -Wall happy
üst
bda7ca77
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
29 additions
and
20 deletions
+29
-20
grammar.c
Parser/grammar.c
+1
-1
intrcheck.c
Parser/intrcheck.c
+3
-0
myreadline.c
Parser/myreadline.c
+2
-0
pgen.c
Parser/pgen.c
+22
-18
pgenmain.c
Parser/pgenmain.c
+1
-0
tokenizer.c
Parser/tokenizer.c
+0
-1
No files found.
Parser/grammar.c
Dosyayı görüntüle @
fd8a3930
...
@@ -159,7 +159,7 @@ findlabel(ll, type, str)
...
@@ -159,7 +159,7 @@ findlabel(ll, type, str)
}
}
fprintf
(
stderr
,
"Label %d/'%s' not found
\n
"
,
type
,
str
);
fprintf
(
stderr
,
"Label %d/'%s' not found
\n
"
,
type
,
str
);
fatal
(
"grammar.c:findlabel()"
);
fatal
(
"grammar.c:findlabel()"
);
/*NOTREACHED
*/
return
0
;
/* Make gcc -Wall happy
*/
}
}
/* Forward */
/* Forward */
...
...
Parser/intrcheck.c
Dosyayı görüntüle @
fd8a3930
...
@@ -125,6 +125,9 @@ intrcheck()
...
@@ -125,6 +125,9 @@ intrcheck()
#include <stdio.h>
#include <stdio.h>
#include <string.h>
#include <string.h>
#include <signal.h>
#include <signal.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
static
int
interrupted
;
static
int
interrupted
;
...
...
Parser/myreadline.c
Dosyayı görüntüle @
fd8a3930
...
@@ -54,6 +54,8 @@ PERFORMANCE OF THIS SOFTWARE.
...
@@ -54,6 +54,8 @@ PERFORMANCE OF THIS SOFTWARE.
extern
char
*
readline
();
extern
char
*
readline
();
extern
int
rl_initialize
();
extern
int
rl_initialize
();
extern
int
rl_insert
();
extern
int
rl_insert
();
extern
int
rl_bind_key
();
extern
void
add_history
();
extern
char
*
rl_readline_name
;
extern
char
*
rl_readline_name
;
#include <setjmp.h>
#include <setjmp.h>
...
...
Parser/pgen.c
Dosyayı görüntüle @
fd8a3930
...
@@ -66,10 +66,14 @@ typedef struct _nfa {
...
@@ -66,10 +66,14 @@ typedef struct _nfa {
}
nfa
;
}
nfa
;
/* Forward */
/* Forward */
static
compile_rhs
PROTO
((
labellist
*
ll
,
nfa
*
nf
,
node
*
n
,
int
*
pa
,
int
*
pb
));
static
void
compile_rhs
PROTO
((
labellist
*
ll
,
static
compile_alt
PROTO
((
labellist
*
ll
,
nfa
*
nf
,
node
*
n
,
int
*
pa
,
int
*
pb
));
nfa
*
nf
,
node
*
n
,
int
*
pa
,
int
*
pb
));
static
compile_item
PROTO
((
labellist
*
ll
,
nfa
*
nf
,
node
*
n
,
int
*
pa
,
int
*
pb
));
static
void
compile_alt
PROTO
((
labellist
*
ll
,
static
compile_atom
PROTO
((
labellist
*
ll
,
nfa
*
nf
,
node
*
n
,
int
*
pa
,
int
*
pb
));
nfa
*
nf
,
node
*
n
,
int
*
pa
,
int
*
pb
));
static
void
compile_item
PROTO
((
labellist
*
ll
,
nfa
*
nf
,
node
*
n
,
int
*
pa
,
int
*
pb
));
static
void
compile_atom
PROTO
((
labellist
*
ll
,
nfa
*
nf
,
node
*
n
,
int
*
pa
,
int
*
pb
));
static
int
static
int
addnfastate
(
nf
)
addnfastate
(
nf
)
...
@@ -128,7 +132,7 @@ typedef struct _nfagrammar {
...
@@ -128,7 +132,7 @@ typedef struct _nfagrammar {
}
nfagrammar
;
}
nfagrammar
;
/* Forward */
/* Forward */
static
compile_rule
PROTO
((
nfagrammar
*
gr
,
node
*
n
));
static
void
compile_rule
PROTO
((
nfagrammar
*
gr
,
node
*
n
));
static
nfagrammar
*
static
nfagrammar
*
newnfagrammar
()
newnfagrammar
()
...
@@ -195,7 +199,7 @@ metacompile(n)
...
@@ -195,7 +199,7 @@ metacompile(n)
return
gr
;
return
gr
;
}
}
static
static
void
compile_rule
(
gr
,
n
)
compile_rule
(
gr
,
n
)
nfagrammar
*
gr
;
nfagrammar
*
gr
;
node
*
n
;
node
*
n
;
...
@@ -216,7 +220,7 @@ compile_rule(gr, n)
...
@@ -216,7 +220,7 @@ compile_rule(gr, n)
REQ
(
n
,
NEWLINE
);
REQ
(
n
,
NEWLINE
);
}
}
static
static
void
compile_rhs
(
ll
,
nf
,
n
,
pa
,
pb
)
compile_rhs
(
ll
,
nf
,
n
,
pa
,
pb
)
labellist
*
ll
;
labellist
*
ll
;
nfa
*
nf
;
nfa
*
nf
;
...
@@ -253,7 +257,7 @@ compile_rhs(ll, nf, n, pa, pb)
...
@@ -253,7 +257,7 @@ compile_rhs(ll, nf, n, pa, pb)
}
}
}
}
static
static
void
compile_alt
(
ll
,
nf
,
n
,
pa
,
pb
)
compile_alt
(
ll
,
nf
,
n
,
pa
,
pb
)
labellist
*
ll
;
labellist
*
ll
;
nfa
*
nf
;
nfa
*
nf
;
...
@@ -284,7 +288,7 @@ compile_alt(ll, nf, n, pa, pb)
...
@@ -284,7 +288,7 @@ compile_alt(ll, nf, n, pa, pb)
}
}
}
}
static
static
void
compile_item
(
ll
,
nf
,
n
,
pa
,
pb
)
compile_item
(
ll
,
nf
,
n
,
pa
,
pb
)
labellist
*
ll
;
labellist
*
ll
;
nfa
*
nf
;
nfa
*
nf
;
...
@@ -325,7 +329,7 @@ compile_item(ll, nf, n, pa, pb)
...
@@ -325,7 +329,7 @@ compile_item(ll, nf, n, pa, pb)
}
}
}
}
static
static
void
compile_atom
(
ll
,
nf
,
n
,
pa
,
pb
)
compile_atom
(
ll
,
nf
,
n
,
pa
,
pb
)
labellist
*
ll
;
labellist
*
ll
;
nfa
*
nf
;
nfa
*
nf
;
...
@@ -437,12 +441,12 @@ typedef struct _ss_dfa {
...
@@ -437,12 +441,12 @@ typedef struct _ss_dfa {
}
ss_dfa
;
}
ss_dfa
;
/* Forward */
/* Forward */
static
printssdfa
PROTO
((
int
xx_nstates
,
ss_state
*
xx_state
,
int
nbits
,
static
void
printssdfa
PROTO
((
int
xx_nstates
,
ss_state
*
xx_state
,
int
nbits
,
labellist
*
ll
,
char
*
msg
));
labellist
*
ll
,
char
*
msg
));
static
simplify
PROTO
((
int
xx_nstates
,
ss_state
*
xx_state
));
static
void
simplify
PROTO
((
int
xx_nstates
,
ss_state
*
xx_state
));
static
convert
PROTO
((
dfa
*
d
,
int
xx_nstates
,
ss_state
*
xx_state
));
static
void
convert
PROTO
((
dfa
*
d
,
int
xx_nstates
,
ss_state
*
xx_state
));
static
static
void
makedfa
(
gr
,
nf
,
d
)
makedfa
(
gr
,
nf
,
d
)
nfagrammar
*
gr
;
nfagrammar
*
gr
;
nfa
*
nf
;
nfa
*
nf
;
...
@@ -548,7 +552,7 @@ makedfa(gr, nf, d)
...
@@ -548,7 +552,7 @@ makedfa(gr, nf, d)
/* XXX cleanup */
/* XXX cleanup */
}
}
static
static
void
printssdfa
(
xx_nstates
,
xx_state
,
nbits
,
ll
,
msg
)
printssdfa
(
xx_nstates
,
xx_state
,
nbits
,
ll
,
msg
)
int
xx_nstates
;
int
xx_nstates
;
ss_state
*
xx_state
;
ss_state
*
xx_state
;
...
@@ -629,7 +633,7 @@ renamestates(xx_nstates, xx_state, from, to)
...
@@ -629,7 +633,7 @@ renamestates(xx_nstates, xx_state, from, to)
}
}
}
}
static
static
void
simplify
(
xx_nstates
,
xx_state
)
simplify
(
xx_nstates
,
xx_state
)
int
xx_nstates
;
int
xx_nstates
;
ss_state
*
xx_state
;
ss_state
*
xx_state
;
...
@@ -661,7 +665,7 @@ simplify(xx_nstates, xx_state)
...
@@ -661,7 +665,7 @@ simplify(xx_nstates, xx_state)
/* Convert the DFA into a grammar that can be used by our parser */
/* Convert the DFA into a grammar that can be used by our parser */
static
static
void
convert
(
d
,
xx_nstates
,
xx_state
)
convert
(
d
,
xx_nstates
,
xx_state
)
dfa
*
d
;
dfa
*
d
;
int
xx_nstates
;
int
xx_nstates
;
...
...
Parser/pgenmain.c
Dosyayı görüntüle @
fd8a3930
...
@@ -101,6 +101,7 @@ main(argc, argv)
...
@@ -101,6 +101,7 @@ main(argc, argv)
printnonterminals
(
g
,
fp
);
printnonterminals
(
g
,
fp
);
fclose
(
fp
);
fclose
(
fp
);
goaway
(
0
);
goaway
(
0
);
return
0
;
/* Make gcc -Wall happy */
}
}
grammar
*
grammar
*
...
...
Parser/tokenizer.c
Dosyayı görüntüle @
fd8a3930
...
@@ -279,7 +279,6 @@ tok_nextc(tok)
...
@@ -279,7 +279,6 @@ tok_nextc(tok)
int
curstart
=
tok
->
start
==
NULL
?
-
1
:
int
curstart
=
tok
->
start
==
NULL
?
-
1
:
tok
->
start
-
tok
->
buf
;
tok
->
start
-
tok
->
buf
;
int
curvalid
=
tok
->
inp
-
tok
->
buf
;
int
curvalid
=
tok
->
inp
-
tok
->
buf
;
int
cursize
=
tok
->
end
-
tok
->
buf
;
int
newsize
=
curvalid
+
BUFSIZ
;
int
newsize
=
curvalid
+
BUFSIZ
;
char
*
newbuf
=
tok
->
buf
;
char
*
newbuf
=
tok
->
buf
;
RESIZE
(
newbuf
,
char
,
newsize
);
RESIZE
(
newbuf
,
char
,
newsize
);
...
...
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