Scanners.pxd 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. from __future__ import absolute_import
  2. import cython
  3. from Cython.Plex.Actions cimport Action
  4. cdef class Scanner:
  5. cdef public lexicon
  6. cdef public stream
  7. cdef public name
  8. cdef public unicode buffer
  9. cdef public Py_ssize_t buf_start_pos
  10. cdef public Py_ssize_t next_pos
  11. cdef public Py_ssize_t cur_pos
  12. cdef public Py_ssize_t cur_line
  13. cdef public Py_ssize_t cur_line_start
  14. cdef public Py_ssize_t start_pos
  15. cdef public Py_ssize_t start_line
  16. cdef public Py_ssize_t start_col
  17. cdef public text
  18. cdef public initial_state # int?
  19. cdef public state_name
  20. cdef public list queue
  21. cdef public bint trace
  22. cdef public cur_char
  23. cdef public long input_state
  24. cdef public level
  25. @cython.final
  26. @cython.locals(input_state=long)
  27. cdef next_char(self)
  28. @cython.locals(action=Action)
  29. cpdef tuple read(self)
  30. @cython.final
  31. cdef tuple scan_a_token(self)
  32. ##cdef tuple position(self) # used frequently by Parsing.py
  33. @cython.final
  34. @cython.locals(cur_pos=Py_ssize_t, cur_line=Py_ssize_t, cur_line_start=Py_ssize_t,
  35. input_state=long, next_pos=Py_ssize_t, state=dict,
  36. buf_start_pos=Py_ssize_t, buf_len=Py_ssize_t, buf_index=Py_ssize_t,
  37. trace=bint, discard=Py_ssize_t, data=unicode, buffer=unicode)
  38. cdef run_machine_inlined(self)
  39. @cython.final
  40. cdef begin(self, state)
  41. @cython.final
  42. cdef produce(self, value, text = *)