+++ /dev/null
-#ifndef Py_TOKENIZER_H\r
-#define Py_TOKENIZER_H\r
-#ifdef __cplusplus\r
-extern "C" {\r
-#endif\r
-\r
-#include "object.h"\r
-\r
-/* Tokenizer interface */\r
-\r
-#include "token.h" /* For token types */\r
-\r
-#define MAXINDENT 100 /* Max indentation level */\r
-\r
-/* Tokenizer state */\r
-struct tok_state {\r
- /* Input state; buf <= cur <= inp <= end */\r
- /* NB an entire line is held in the buffer */\r
- char *buf; /* Input buffer, or NULL; malloc'ed if fp != NULL */\r
- char *cur; /* Next character in buffer */\r
- char *inp; /* End of data in buffer */\r
- char *end; /* End of input buffer if buf != NULL */\r
- char *start; /* Start of current token if not NULL */\r
- int done; /* E_OK normally, E_EOF at EOF, otherwise error code */\r
- /* NB If done != E_OK, cur must be == inp!!! */\r
- FILE *fp; /* Rest of input; NULL if tokenizing a string */\r
- int tabsize; /* Tab spacing */\r
- int indent; /* Current indentation index */\r
- int indstack[MAXINDENT]; /* Stack of indents */\r
- int atbol; /* Nonzero if at begin of new line */\r
- int pendin; /* Pending indents (if > 0) or dedents (if < 0) */\r
- char *prompt, *nextprompt; /* For interactive prompting */\r
- int lineno; /* Current line number */\r
- int level; /* () [] {} Parentheses nesting level */\r
- /* Used to allow free continuations inside them */\r
- /* Stuff for checking on different tab sizes */\r
- const char *filename; /* For error messages */\r
- int altwarning; /* Issue warning if alternate tabs don't match */\r
- int alterror; /* Issue error if alternate tabs don't match */\r
- int alttabsize; /* Alternate tab spacing */\r
- int altindstack[MAXINDENT]; /* Stack of alternate indents */\r
- /* Stuff for PEP 0263 */\r
- int decoding_state; /* -1:decoding, 0:init, 1:raw */\r
- int decoding_erred; /* whether erred in decoding */\r
- int read_coding_spec; /* whether 'coding:...' has been read */\r
- char *encoding;\r
- int cont_line; /* whether we are in a continuation line. */\r
- const char* line_start; /* pointer to start of current line */\r
-#ifndef PGEN\r
- PyObject *decoding_readline; /* codecs.open(...).readline */\r
- PyObject *decoding_buffer;\r
-#endif\r
- const char* enc;\r
- const char* str;\r
- const char* input; /* Tokenizer's newline translated copy of the string. */\r
-};\r
-\r
-extern struct tok_state *PyTokenizer_FromString(const char *, int);\r
-extern struct tok_state *PyTokenizer_FromFile(FILE *, char *, char *);\r
-extern void PyTokenizer_Free(struct tok_state *);\r
-extern int PyTokenizer_Get(struct tok_state *, char **, char **);\r
-#if defined(PGEN) || defined(Py_USING_UNICODE)\r
-extern char * PyTokenizer_RestoreEncoding(struct tok_state* tok,\r
- int len, int *offset);\r
-#endif\r
-\r
-#ifdef __cplusplus\r
-}\r
-#endif\r
-#endif /* !Py_TOKENIZER_H */\r