diff options
author | Pablo Galindo <Pablogsal@gmail.com> | 2020-06-11 16:30:46 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-11 16:30:46 (GMT) |
commit | 1ed83adb0e95305af858bd41af531e487f54fee7 (patch) | |
tree | 5b05876e1800975fd2f0b8021544423f9fd9822a /Parser/grammar1.c | |
parent | 311110abcd8ab648dbf1803e36a8ba5d93fa019b (diff) | |
download | cpython-1ed83adb0e95305af858bd41af531e487f54fee7.zip cpython-1ed83adb0e95305af858bd41af531e487f54fee7.tar.gz cpython-1ed83adb0e95305af858bd41af531e487f54fee7.tar.bz2 |
bpo-40939: Remove the old parser (GH-20768)
This commit removes the old parser, the deprecated parser module, the old parser compatibility flags and environment variables and all associated support code and documentation.
Diffstat (limited to 'Parser/grammar1.c')
-rw-r--r-- | Parser/grammar1.c | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/Parser/grammar1.c b/Parser/grammar1.c deleted file mode 100644 index c702040..0000000 --- a/Parser/grammar1.c +++ /dev/null @@ -1,47 +0,0 @@ - -/* Grammar subroutines needed by parser */ - -#include "Python.h" -#include "grammar.h" -#include "token.h" - -/* Return the DFA for the given type */ - -const dfa * -PyGrammar_FindDFA(grammar *g, int type) -{ - /* Massive speed-up */ - const dfa *d = &g->g_dfa[type - NT_OFFSET]; - assert(d->d_type == type); - return d; -} - -const char * -PyGrammar_LabelRepr(label *lb) -{ - static char buf[100]; - - if (lb->lb_type == ENDMARKER) - return "EMPTY"; - else if (ISNONTERMINAL(lb->lb_type)) { - if (lb->lb_str == NULL) { - PyOS_snprintf(buf, sizeof(buf), "NT%d", lb->lb_type); - return buf; - } - else - return lb->lb_str; - } - else if (lb->lb_type < N_TOKENS) { - if (lb->lb_str == NULL) - return _PyParser_TokenNames[lb->lb_type]; - else { - PyOS_snprintf(buf, sizeof(buf), "%.32s(%.32s)", - _PyParser_TokenNames[lb->lb_type], lb->lb_str); - return buf; - } - } - else { - Py_FatalError("invalid grammar label"); - return NULL; - } -} |