Scanning.pxd 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. from __future__ import absolute_import
  2. import cython
  3. from ..Plex.Scanners cimport Scanner
  4. cdef unicode any_string_prefix, IDENT
  5. cdef get_lexicon()
  6. cdef initial_compile_time_env()
  7. cdef class Method:
  8. cdef object name
  9. cdef dict kwargs
  10. cdef readonly object __name__ # for tracing the scanner
  11. ## methods commented with '##' out are used by Parsing.py when compiled.
  12. @cython.final
  13. cdef class CompileTimeScope:
  14. cdef public dict entries
  15. cdef public CompileTimeScope outer
  16. ##cdef declare(self, name, value)
  17. ##cdef lookup_here(self, name)
  18. ##cpdef lookup(self, name)
  19. @cython.final
  20. cdef class PyrexScanner(Scanner):
  21. cdef public context
  22. cdef public list included_files
  23. cdef public CompileTimeScope compile_time_env
  24. cdef public bint compile_time_eval
  25. cdef public bint compile_time_expr
  26. cdef public bint parse_comments
  27. cdef public bint in_python_file
  28. cdef public source_encoding
  29. cdef set keywords
  30. cdef public list indentation_stack
  31. cdef public indentation_char
  32. cdef public int bracket_nesting_level
  33. cdef readonly bint async_enabled
  34. cdef public sy
  35. cdef public systring
  36. cdef long current_level(self)
  37. #cpdef commentline(self, text)
  38. #cpdef open_bracket_action(self, text)
  39. #cpdef close_bracket_action(self, text)
  40. #cpdef newline_action(self, text)
  41. #cpdef begin_string_action(self, text)
  42. #cpdef end_string_action(self, text)
  43. #cpdef unclosed_string_action(self, text)
  44. @cython.locals(current_level=cython.long, new_level=cython.long)
  45. cpdef indentation_action(self, text)
  46. #cpdef eof_action(self, text)
  47. ##cdef next(self)
  48. ##cdef peek(self)
  49. #cpdef put_back(self, sy, systring)
  50. #cdef unread(self, token, value)
  51. ##cdef bint expect(self, what, message = *) except -2
  52. ##cdef expect_keyword(self, what, message = *)
  53. ##cdef expected(self, what, message = *)
  54. ##cdef expect_indent(self)
  55. ##cdef expect_dedent(self)
  56. ##cdef expect_newline(self, message=*, bint ignore_semicolon=*)
  57. ##cdef int enter_async(self) except -1
  58. ##cdef int exit_async(self) except -1