parsetok.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /* Parser-tokenizer link interface */
  2. #ifndef Py_PARSETOK_H
  3. #define Py_PARSETOK_H
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. typedef struct {
  8. int error;
  9. const char *filename;
  10. int lineno;
  11. int offset;
  12. char *text;
  13. int token;
  14. int expected;
  15. } perrdetail;
  16. #if 0
  17. #define PyPARSE_YIELD_IS_KEYWORD 0x0001
  18. #endif
  19. #define PyPARSE_DONT_IMPLY_DEDENT 0x0002
  20. #if 0
  21. #define PyPARSE_WITH_IS_KEYWORD 0x0003
  22. #endif
  23. #define PyPARSE_PRINT_IS_FUNCTION 0x0004
  24. #define PyPARSE_UNICODE_LITERALS 0x0008
  25. PyAPI_FUNC(node *) PyParser_ParseString(const char *, grammar *, int,
  26. perrdetail *);
  27. PyAPI_FUNC(node *) PyParser_ParseFile (FILE *, const char *, grammar *, int,
  28. char *, char *, perrdetail *);
  29. PyAPI_FUNC(node *) PyParser_ParseStringFlags(const char *, grammar *, int,
  30. perrdetail *, int);
  31. PyAPI_FUNC(node *) PyParser_ParseFileFlags(FILE *, const char *, grammar *,
  32. int, char *, char *,
  33. perrdetail *, int);
  34. PyAPI_FUNC(node *) PyParser_ParseFileFlagsEx(FILE *, const char *, grammar *,
  35. int, char *, char *,
  36. perrdetail *, int *);
  37. PyAPI_FUNC(node *) PyParser_ParseStringFlagsFilename(const char *,
  38. const char *,
  39. grammar *, int,
  40. perrdetail *, int);
  41. PyAPI_FUNC(node *) PyParser_ParseStringFlagsFilenameEx(const char *,
  42. const char *,
  43. grammar *, int,
  44. perrdetail *, int *);
  45. /* Note that he following function is defined in pythonrun.c not parsetok.c. */
  46. PyAPI_FUNC(void) PyParser_SetError(perrdetail *);
  47. #ifdef __cplusplus
  48. }
  49. #endif
  50. #endif /* !Py_PARSETOK_H */