Current Dir: /usr/include/python3.9/

[DIR]  cpython [ delete | rename ]
[DIR]  internal [ delete | rename ]
[FILE] abstract.h [ edit | delete | rename ]
[FILE] asdl.h [ edit | delete | rename ]
[FILE] ast.h [ edit | delete | rename ]
[FILE] bitset.h [ edit | delete | rename ]
[FILE] bltinmodule.h [ edit | delete | rename ]
[FILE] boolobject.h [ edit | delete | rename ]
[FILE] bytearrayobject.h [ edit | delete | rename ]
[FILE] bytesobject.h [ edit | delete | rename ]
[FILE] cellobject.h [ edit | delete | rename ]
[FILE] ceval.h [ edit | delete | rename ]
[FILE] classobject.h [ edit | delete | rename ]
[FILE] code.h [ edit | delete | rename ]
[FILE] codecs.h [ edit | delete | rename ]
[FILE] compile.h [ edit | delete | rename ]
[FILE] complexobject.h [ edit | delete | rename ]
[FILE] context.h [ edit | delete | rename ]
[FILE] datetime.h [ edit | delete | rename ]
[FILE] descrobject.h [ edit | delete | rename ]
[FILE] dictobject.h [ edit | delete | rename ]
[FILE] dynamic_annotations.h [ edit | delete | rename ]
[FILE] enumobject.h [ edit | delete | rename ]
[FILE] errcode.h [ edit | delete | rename ]
[FILE] eval.h [ edit | delete | rename ]
[FILE] exports.h [ edit | delete | rename ]
[FILE] fileobject.h [ edit | delete | rename ]
[FILE] fileutils.h [ edit | delete | rename ]
[FILE] floatobject.h [ edit | delete | rename ]
[FILE] frameobject.h [ edit | delete | rename ]
[FILE] funcobject.h [ edit | delete | rename ]
[FILE] genericaliasobject.h [ edit | delete | rename ]
[FILE] genobject.h [ edit | delete | rename ]
[FILE] graminit.h [ edit | delete | rename ]
[FILE] grammar.h [ edit | delete | rename ]
[FILE] import.h [ edit | delete | rename ]
[FILE] interpreteridobject.h [ edit | delete | rename ]
[FILE] intrcheck.h [ edit | delete | rename ]
[FILE] iterobject.h [ edit | delete | rename ]
[FILE] listobject.h [ edit | delete | rename ]
[FILE] longintrepr.h [ edit | delete | rename ]
[FILE] longobject.h [ edit | delete | rename ]
[FILE] marshal.h [ edit | delete | rename ]
[FILE] memoryobject.h [ edit | delete | rename ]
[FILE] methodobject.h [ edit | delete | rename ]
[FILE] modsupport.h [ edit | delete | rename ]
[FILE] moduleobject.h [ edit | delete | rename ]
[FILE] namespaceobject.h [ edit | delete | rename ]
[FILE] node.h [ edit | delete | rename ]
[FILE] object.h [ edit | delete | rename ]
[FILE] objimpl.h [ edit | delete | rename ]
[FILE] odictobject.h [ edit | delete | rename ]
[FILE] opcode.h [ edit | delete | rename ]
[FILE] osdefs.h [ edit | delete | rename ]
[FILE] osmodule.h [ edit | delete | rename ]
[FILE] parsetok.h [ edit | delete | rename ]
[FILE] patchlevel.h [ edit | delete | rename ]
[FILE] picklebufobject.h [ edit | delete | rename ]
[FILE] pyarena.h [ edit | delete | rename ]
[FILE] pycapsule.h [ edit | delete | rename ]
[FILE] pyconfig-64.h [ edit | delete | rename ]
[FILE] pyconfig.h [ edit | delete | rename ]
[FILE] pyctype.h [ edit | delete | rename ]
[FILE] pydebug.h [ edit | delete | rename ]
[FILE] pydtrace.h [ edit | delete | rename ]
[FILE] pyerrors.h [ edit | delete | rename ]
[FILE] pyexpat.h [ edit | delete | rename ]
[FILE] pyfpe.h [ edit | delete | rename ]
[FILE] pyframe.h [ edit | delete | rename ]
[FILE] pyhash.h [ edit | delete | rename ]
[FILE] pylifecycle.h [ edit | delete | rename ]
[FILE] pymacconfig.h [ edit | delete | rename ]
[FILE] pymacro.h [ edit | delete | rename ]
[FILE] pymath.h [ edit | delete | rename ]
[FILE] pymem.h [ edit | delete | rename ]
[FILE] pyport.h [ edit | delete | rename ]
[FILE] pystate.h [ edit | delete | rename ]
[FILE] pystrcmp.h [ edit | delete | rename ]
[FILE] pystrhex.h [ edit | delete | rename ]
[FILE] pystrtod.h [ edit | delete | rename ]
[FILE] Python-ast.h [ edit | delete | rename ]
[FILE] Python.h [ edit | delete | rename ]
[FILE] pythonrun.h [ edit | delete | rename ]
[FILE] pythread.h [ edit | delete | rename ]
[FILE] pytime.h [ edit | delete | rename ]
[FILE] py_curses.h [ edit | delete | rename ]
[FILE] rangeobject.h [ edit | delete | rename ]
[FILE] setobject.h [ edit | delete | rename ]
[FILE] sliceobject.h [ edit | delete | rename ]
[FILE] structmember.h [ edit | delete | rename ]
[FILE] structseq.h [ edit | delete | rename ]
[FILE] symtable.h [ edit | delete | rename ]
[FILE] sysmodule.h [ edit | delete | rename ]
[FILE] token.h [ edit | delete | rename ]
[FILE] traceback.h [ edit | delete | rename ]
[FILE] tracemalloc.h [ edit | delete | rename ]
[FILE] tupleobject.h [ edit | delete | rename ]
[FILE] typeslots.h [ edit | delete | rename ]
[FILE] ucnhash.h [ edit | delete | rename ]
[FILE] unicodeobject.h [ edit | delete | rename ]
[FILE] warnings.h [ edit | delete | rename ]
[FILE] weakrefobject.h [ edit | delete | rename ]

Viewing: /usr/include/python3.9/grammar.h


/* Grammar interface */

#ifndef Py_GRAMMAR_H
#define Py_GRAMMAR_H
#ifdef __cplusplus
extern "C" {
#endif

#include "bitset.h" /* Sigh... */

/* A label of an arc */

typedef struct {
    int          lb_type;
    const char  *lb_str;
} label;

#define EMPTY 0         /* Label number 0 is by definition the empty label */

/* A list of labels */

typedef struct {
    int          ll_nlabels;
    const label *ll_label;
} labellist;

/* An arc from one state to another */

typedef struct {
    short       a_lbl;          /* Label of this arc */
    short       a_arrow;        /* State where this arc goes to */
} arc;

/* A state in a DFA */

typedef struct {
    int          s_narcs;
    const arc   *s_arc;         /* Array of arcs */

    /* Optional accelerators */
    int          s_lower;       /* Lowest label index */
    int          s_upper;       /* Highest label index */
    int         *s_accel;       /* Accelerator */
    int          s_accept;      /* Nonzero for accepting state */
} state;

/* A DFA */

typedef struct {
    int          d_type;        /* Non-terminal this represents */
    char        *d_name;        /* For printing */
    int          d_nstates;
    state       *d_state;       /* Array of states */
    bitset       d_first;
} dfa;

/* A grammar */

typedef struct {
    int          g_ndfas;
    const dfa   *g_dfa;         /* Array of DFAs */
    const labellist g_ll;
    int          g_start;       /* Start symbol of the grammar */
    int          g_accel;       /* Set if accelerators present */
} grammar;

/* FUNCTIONS */
const dfa *PyGrammar_FindDFA(grammar *g, int type);
const char *PyGrammar_LabelRepr(label *lb);
void PyGrammar_AddAccelerators(grammar *g);
void PyGrammar_RemoveAccelerators(grammar *);

#ifdef __cplusplus
}
#endif
#endif /* !Py_GRAMMAR_H */

Upload File: