package baguette_sharp

  1. Overview
  2. Docs

The Token Module

type token_type =
  1. | LEFT_PARENTHESIS
  2. | RIGHT_PARENTHESIS
  3. | KEYWORD of string
  4. | QUOTE
  5. | SEMI_COLON
  6. | INT_TOKEN of int
  7. | FLOAT_TOKEN of float
  8. | NULL_TOKEN
  9. | STRING_TOKEN of string
  10. | BOOL_TOKEN of bool
  11. | ARRAY_BEGIN
  12. | PARAM_BEGIN
  13. | ARRAY_END
  14. | PARAM_END
  15. | COMMENT
  16. | COMMA

Type of tokens

val string_to_token : string -> token_type

Parses a string into a token

val recognized_token : string list

A list of token recognized by the lexer

val token_to_string : token_type -> string

Transforms a token into a string

val token_to_litteral_string : token_type -> string

Transforms the value of a token into a string

val pretty_print : Format.formatter -> token_type -> unit

Pretty print a token

val print_token_list : token_type list -> unit

Prints a list of token

OCaml

Innovation. Community. Security.