package containers

  1. Overview
  2. Docs
On This Page
  1. Streaming Lexer
Legend:
Library
Module
Module type
Parameter
Class
Class type
Streaming Lexer

splits the input into opening parenthesis, closing ones, and atoms

type t

A streaming lexer, that parses atomic chunks of S-expressions (atoms and delimiters)

val make : Source.t -> t

Create a lexer that uses the given source of characters as an input

val of_string : string -> t
val of_chan : Pervasives.in_channel -> t
val line : t -> int
val col : t -> int

Obtain next token

type token =
  1. | Open
  2. | Close
  3. | Atom of string
    (*

    An individual S-exp token

    *)
val next : t -> token partial_result

Obtain the next token, an error, or block/end stream

OCaml

Innovation. Community. Security.