diff options
author | Pablo Galindo <Pablogsal@gmail.com> | 2019-04-13 16:05:14 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-13 16:05:14 (GMT) |
commit | f2cf1e3e2892a6326949c2570f1bb6d6c95715fb (patch) | |
tree | bc8ec61893d284fe2e805191b2ba3c4a59a43879 /Include | |
parent | f8716c88f13f035c126fc1db499ae0ea309c7ece (diff) | |
download | cpython-f2cf1e3e2892a6326949c2570f1bb6d6c95715fb.zip cpython-f2cf1e3e2892a6326949c2570f1bb6d6c95715fb.tar.gz cpython-f2cf1e3e2892a6326949c2570f1bb6d6c95715fb.tar.bz2 |
bpo-36623: Clean parser headers and include files (GH-12253)
After the removal of pgen, multiple header and function prototypes that lack implementation or are unused are still lying around.
Diffstat (limited to 'Include')
-rw-r--r-- | Include/bitset.h | 9 | ||||
-rw-r--r-- | Include/grammar.h | 16 | ||||
-rw-r--r-- | Include/pgenheaders.h | 43 |
3 files changed, 0 insertions, 68 deletions
diff --git a/Include/bitset.h b/Include/bitset.h index b22fa77..6a2ac97 100644 --- a/Include/bitset.h +++ b/Include/bitset.h @@ -8,23 +8,14 @@ extern "C" { /* Bitset interface */ #define BYTE char - typedef BYTE *bitset; -bitset newbitset(int nbits); -void delbitset(bitset bs); #define testbit(ss, ibit) (((ss)[BIT2BYTE(ibit)] & BIT2MASK(ibit)) != 0) -int addbit(bitset bs, int ibit); /* Returns 0 if already set */ -int samebitset(bitset bs1, bitset bs2, int nbits); -void mergebitset(bitset bs1, bitset bs2, int nbits); #define BITSPERBYTE (8*sizeof(BYTE)) -#define NBYTES(nbits) (((nbits) + BITSPERBYTE - 1) / BITSPERBYTE) - #define BIT2BYTE(ibit) ((ibit) / BITSPERBYTE) #define BIT2SHIFT(ibit) ((ibit) % BITSPERBYTE) #define BIT2MASK(ibit) (1 << BIT2SHIFT(ibit)) -#define BYTE2BIT(ibyte) ((ibyte) * BITSPERBYTE) #ifdef __cplusplus } diff --git a/Include/grammar.h b/Include/grammar.h index 68b928c..7a6182b 100644 --- a/Include/grammar.h +++ b/Include/grammar.h @@ -66,27 +66,11 @@ typedef struct { } grammar; /* FUNCTIONS */ - -grammar *newgrammar(int start); -void freegrammar(grammar *g); -dfa *adddfa(grammar *g, int type, const char *name); -int addstate(dfa *d); -void addarc(dfa *d, int from, int to, int lbl); dfa *PyGrammar_FindDFA(grammar *g, int type); - -int addlabel(labellist *ll, int type, const char *str); -int findlabel(labellist *ll, int type, const char *str); const char *PyGrammar_LabelRepr(label *lb); -void translatelabels(grammar *g); - -void addfirstsets(grammar *g); - void PyGrammar_AddAccelerators(grammar *g); void PyGrammar_RemoveAccelerators(grammar *); -void printgrammar(grammar *g, FILE *fp); -void printnonterminals(grammar *g, FILE *fp); - #ifdef __cplusplus } #endif diff --git a/Include/pgenheaders.h b/Include/pgenheaders.h deleted file mode 100644 index dbc5e0a..0000000 --- a/Include/pgenheaders.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef Py_PGENHEADERS_H -#define Py_PGENHEADERS_H -#ifdef __cplusplus -extern "C" { -#endif - - -/* Include files and extern declarations used by most of the parser. */ - -#include "Python.h" - -PyAPI_FUNC(void) PySys_WriteStdout(const char *format, ...) - Py_GCC_ATTRIBUTE((format(printf, 1, 2))); -PyAPI_FUNC(void) PySys_WriteStderr(const char *format, ...) - Py_GCC_ATTRIBUTE((format(printf, 1, 2))); - -#define addarc _Py_addarc -#define addbit _Py_addbit -#define adddfa _Py_adddfa -#define addfirstsets _Py_addfirstsets -#define addlabel _Py_addlabel -#define addstate _Py_addstate -#define delbitset _Py_delbitset -#define dumptree _Py_dumptree -#define findlabel _Py_findlabel -#define freegrammar _Py_freegrammar -#define mergebitset _Py_mergebitset -#define meta_grammar _Py_meta_grammar -#define newbitset _Py_newbitset -#define newgrammar _Py_newgrammar -#define pgen _Py_pgen -#define printgrammar _Py_printgrammar -#define printnonterminals _Py_printnonterminals -#define printtree _Py_printtree -#define samebitset _Py_samebitset -#define showtree _Py_showtree -#define tok_dump _Py_tok_dump -#define translatelabels _Py_translatelabels - -#ifdef __cplusplus -} -#endif -#endif /* !Py_PGENHEADERS_H */ |