package camlpdf

  1. Overview
  2. Docs

A very fast lexer for very basic tokens

type t =
  1. | LexNull
  2. | LexBool of bool
  3. | LexInt of int
  4. | LexReal of float
  5. | LexString of string
  6. | LexName of string
  7. | LexLeftSquare
  8. | LexRightSquare
  9. | LexLeftDict
  10. | LexRightDict
  11. | LexStream of Pdf.stream
  12. | LexEndStream
  13. | LexObj
  14. | LexEndObj
  15. | LexR
  16. | LexComment
  17. | StopLexing
  18. | LexNone

To avoid too much storage allocation (and hence garbage collection), we use the same data type for this very basic lexing module as for the main lexing in Pdfread. Eventually, we may unify this with the parsing type too.

val string_of_token : t -> string

For debug only.

val string_of_tokens : t list -> string

For debug only.

val lex_single : Pdfio.input -> t

Lex a single token from a Pdfio.input.

val lex : Pdfio.input -> t list

Lex all the token in a Pdfio.input.

val lex_string : string -> t list

Lex all the tokens from a string.

OCaml

Innovation. Community. Security.