Add a lexer for JSON

Our JSON parser is a three stage parser.  The first stage tokenizes the stream
into a set of lexical tokens.  Since the lexical grammar is regular, we can
use a finite state machine to model it.  The state machine will emit tokens
as they are identified.

Signed-off-by: Anthony Liguori <[email protected]>
3 files changed
tree: 16816c800937ed04e07bb1fa92b82e80bd2913b1
  1. audio/
  2. block/
  3. bsd-user/
  4. darwin-user/
  5. default-configs/
  6. fpu/
  7. gdb-xml/
  8. hw/
  9. linux-user/
  10. net/
  11. pc-bios/
  12. roms/
  13. slirp/
  14. target-alpha/
  15. target-arm/
  16. target-cris/
  17. target-i386/
  18. target-m68k/
  19. target-microblaze/
  20. target-mips/
  21. target-ppc/
  22. target-sh4/
  23. target-sparc/
  24. tcg/
  25. tests/
  26. .gitignore
  27. .gitmodules
  28. a.out.h
  29. acl.c
  30. acl.h
  31. aes.c
  32. aes.h
  33. aio.c
  34. alpha-dis.c
  35. alpha.ld
  36. arm-dis.c
  37. arm-semi.c
  38. arm.ld
  39. async.c
  40. balloon.h
  41. block-migration.c
  42. block-migration.h
  43. block.c
  44. block.h
  45. block_int.h
  46. bswap.h
  47. bt-host.c
  48. bt-host.h
  49. bt-vhci.c
  50. buffered_file.c
  51. buffered_file.h
  52. cache-utils.c
  53. cache-utils.h
  54. Changelog
  55. check-qdict.c
  56. check-qfloat.c
  57. check-qint.c
  58. check-qlist.c
  59. check-qstring.c
  60. cmd.c
  61. cmd.h
  62. cocoa.m
  63. CODING_STYLE
  64. config.h
  65. configure
  66. console.c
  67. console.h
  68. COPYING
  69. COPYING.LIB
  70. cpu-all.h
  71. cpu-common.h
  72. cpu-defs.h
  73. cpu-exec.c
  74. create_config
  75. cris-dis.c
  76. curses.c
  77. curses_keys.h
  78. cutils.c
  79. d3des.c
  80. d3des.h
  81. def-helper.h
  82. device_tree.c
  83. device_tree.h
  84. dis-asm.h
  85. disas.c
  86. disas.h
  87. dma-helpers.c
  88. dma.h
  89. dyngen-exec.h
  90. elf.h
  91. envlist.c
  92. envlist.h
  93. exec-all.h
  94. exec.c
  95. feature_to_c.sh
  96. gdbstub.c
  97. gdbstub.h
  98. gen-icount.h
  99. host-utils.c
  100. host-utils.h
  101. hostregs_helper.h
  102. hpet.h
  103. hppa-dis.c
  104. hppa.ld
  105. hxtool
  106. i386-dis.c
  107. i386.ld
  108. ia64.ld
  109. ioport-user.c
  110. ioport.c
  111. ioport.h
  112. json-lexer.c
  113. json-lexer.h
  114. keymaps.c
  115. keymaps.h
  116. kvm-all.c
  117. kvm.h
  118. libfdt_env.h
  119. LICENSE
  120. linux-aio.c
  121. m68k-dis.c
  122. m68k-semi.c
  123. m68k.ld
  124. MAINTAINERS
  125. Makefile
  126. Makefile.hw
  127. Makefile.target
  128. Makefile.user
  129. microblaze-dis.c
  130. migration-exec.c
  131. migration-fd.c
  132. migration-tcp.c
  133. migration-unix.c
  134. migration.c
  135. migration.h
  136. mips-dis.c
  137. mips.ld
  138. module.c
  139. module.h
  140. monitor.c
  141. monitor.h
  142. nbd.c
  143. nbd.h
  144. net-checksum.c
  145. net.c
  146. net.h
  147. osdep.c
  148. osdep.h
  149. path.c
  150. pci-ids.txt
  151. posix-aio-compat.c
  152. ppc-dis.c
  153. ppc.ld
  154. ppc64.ld
  155. qbool.c
  156. qbool.h
  157. qdict-test-data.txt
  158. qdict.c
  159. qdict.h
  160. qemu-aio.h
  161. qemu-binfmt-conf.sh
  162. qemu-char.c
  163. qemu-char.h
  164. qemu-common.h
  165. qemu-config.c
  166. qemu-config.h
  167. qemu-doc.texi
  168. qemu-img-cmds.hx
  169. qemu-img.c
  170. qemu-img.texi
  171. qemu-io.c
  172. qemu-lock.h
  173. qemu-log.h
  174. qemu-malloc.c
  175. qemu-monitor.hx
  176. qemu-nbd.c
  177. qemu-nbd.texi
  178. qemu-option.c
  179. qemu-option.h
  180. qemu-options.hx
  181. qemu-queue.h
  182. qemu-sockets.c
  183. qemu-tech.texi
  184. qemu-thread.c
  185. qemu-thread.h
  186. qemu-timer.h
  187. qemu-tool.c
  188. qemu.sasl
  189. qemu_socket.h
  190. qfloat.c
  191. qfloat.h
  192. qint.c
  193. qint.h
  194. qlist.c
  195. qlist.h
  196. qobject.h
  197. qstring.c
  198. qstring.h
  199. readline.c
  200. readline.h
  201. README
  202. rules.mak
  203. s390-dis.c
  204. s390.ld
  205. savevm.c
  206. sdl.c
  207. sdl_keysym.h
  208. sdl_zoom.c
  209. sdl_zoom.h
  210. sdl_zoom_template.h
  211. sh4-dis.c
  212. softmmu-semi.h
  213. softmmu_defs.h
  214. softmmu_exec.h
  215. softmmu_header.h
  216. softmmu_template.h
  217. sparc-dis.c
  218. sparc.ld
  219. sparc64.ld
  220. sysemu.h
  221. targphys.h
  222. tcg-runtime.c
  223. texi2pod.pl
  224. thunk.c
  225. thunk.h
  226. TODO
  227. translate-all.c
  228. uboot_image.h
  229. usb-bsd.c
  230. usb-linux.c
  231. usb-stub.c
  232. VERSION
  233. vgafont.h
  234. vl.c
  235. vnc-auth-sasl.c
  236. vnc-auth-sasl.h
  237. vnc-auth-vencrypt.c
  238. vnc-auth-vencrypt.h
  239. vnc-tls.c
  240. vnc-tls.h
  241. vnc.c
  242. vnc.h
  243. vnc_keysym.h
  244. vnchextile.h
  245. x86_64.ld
  246. x_keymap.c
  247. x_keymap.h