<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Token (baguette_sharp.Baguette_sharp.Token)</title><link rel="stylesheet" href="../../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.1.0"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> â€“ <a href="../../index.html">baguette_sharp</a> &#x00BB; <a href="../index.html">Baguette_sharp</a> &#x00BB; Token</nav><header class="odoc-preamble"><h1>Module <code><span>Baguette_sharp.Token</span></code></h1><p>The Token Module</p></header><div class="odoc-content"><div class="odoc-spec"><div class="spec type" id="type-token_type" class="anchored"><a href="#type-token_type" class="anchor"></a><code><span><span class="keyword">type</span> token_type</span><span> = </span></code><table><tr id="type-token_type.LEFT_PARENTHESIS" class="anchored"><td class="def variant constructor"><a href="#type-token_type.LEFT_PARENTHESIS" class="anchor"></a><code><span>| </span><span><span class="constructor">LEFT_PARENTHESIS</span></span></code></td></tr><tr id="type-token_type.RIGHT_PARENTHESIS" class="anchored"><td class="def variant constructor"><a href="#type-token_type.RIGHT_PARENTHESIS" class="anchor"></a><code><span>| </span><span><span class="constructor">RIGHT_PARENTHESIS</span></span></code></td></tr><tr id="type-token_type.KEYWORD" class="anchored"><td class="def variant constructor"><a href="#type-token_type.KEYWORD" class="anchor"></a><code><span>| </span><span><span class="constructor">KEYWORD</span> <span class="keyword">of</span> string</span></code></td></tr><tr id="type-token_type.QUOTE" class="anchored"><td class="def variant constructor"><a href="#type-token_type.QUOTE" class="anchor"></a><code><span>| </span><span><span class="constructor">QUOTE</span></span></code></td></tr><tr id="type-token_type.SEMI_COLON" class="anchored"><td class="def variant constructor"><a href="#type-token_type.SEMI_COLON" class="anchor"></a><code><span>| </span><span><span class="constructor">SEMI_COLON</span></span></code></td></tr><tr id="type-token_type.INT_TOKEN" class="anchored"><td class="def variant constructor"><a href="#type-token_type.INT_TOKEN" class="anchor"></a><code><span>| </span><span><span class="constructor">INT_TOKEN</span> <span class="keyword">of</span> int</span></code></td></tr><tr id="type-token_type.FLOAT_TOKEN" class="anchored"><td class="def variant constructor"><a href="#type-token_type.FLOAT_TOKEN" class="anchor"></a><code><span>| </span><span><span class="constructor">FLOAT_TOKEN</span> <span class="keyword">of</span> float</span></code></td></tr><tr id="type-token_type.NULL_TOKEN" class="anchored"><td class="def variant constructor"><a href="#type-token_type.NULL_TOKEN" class="anchor"></a><code><span>| </span><span><span class="constructor">NULL_TOKEN</span></span></code></td></tr><tr id="type-token_type.STRING_TOKEN" class="anchored"><td class="def variant constructor"><a href="#type-token_type.STRING_TOKEN" class="anchor"></a><code><span>| </span><span><span class="constructor">STRING_TOKEN</span> <span class="keyword">of</span> string</span></code></td></tr><tr id="type-token_type.BOOL_TOKEN" class="anchored"><td class="def variant constructor"><a href="#type-token_type.BOOL_TOKEN" class="anchor"></a><code><span>| </span><span><span class="constructor">BOOL_TOKEN</span> <span class="keyword">of</span> bool</span></code></td></tr><tr id="type-token_type.ARRAY_BEGIN" class="anchored"><td class="def variant constructor"><a href="#type-token_type.ARRAY_BEGIN" class="anchor"></a><code><span>| </span><span><span class="constructor">ARRAY_BEGIN</span></span></code></td></tr><tr id="type-token_type.ARRAY_END" class="anchored"><td class="def variant constructor"><a href="#type-token_type.ARRAY_END" class="anchor"></a><code><span>| </span><span><span class="constructor">ARRAY_END</span></span></code></td></tr><tr id="type-token_type.COMMENT" class="anchored"><td class="def variant constructor"><a href="#type-token_type.COMMENT" class="anchor"></a><code><span>| </span><span><span class="constructor">COMMENT</span></span></code></td></tr><tr id="type-token_type.COMMA" class="anchored"><td class="def variant constructor"><a href="#type-token_type.COMMA" class="anchor"></a><code><span>| </span><span><span class="constructor">COMMA</span></span></code></td></tr></table></div><div class="spec-doc"><p>Type of tokens</p></div></div><div class="odoc-spec"><div class="spec value" id="val-string_to_token" class="anchored"><a href="#val-string_to_token" class="anchor"></a><code><span><span class="keyword">val</span> string_to_token : <span>string <span class="arrow">&#45;&gt;</span></span> <a href="#type-token_type">token_type</a></span></code></div><div class="spec-doc"><p>Parses a string into a token</p></div></div><div class="odoc-spec"><div class="spec value" id="val-recognized_token" class="anchored"><a href="#val-recognized_token" class="anchor"></a><code><span><span class="keyword">val</span> recognized_token : <span>string list</span></span></code></div><div class="spec-doc"><p>A list of token recognized by the lexer</p></div></div><div class="odoc-spec"><div class="spec value" id="val-token_to_string" class="anchored"><a href="#val-token_to_string" class="anchor"></a><code><span><span class="keyword">val</span> token_to_string : <span><a href="#type-token_type">token_type</a> <span class="arrow">&#45;&gt;</span></span> string</span></code></div><div class="spec-doc"><p>Transforms a token into a string</p></div></div><div class="odoc-spec"><div class="spec value" id="val-token_to_litteral_string" class="anchored"><a href="#val-token_to_litteral_string" class="anchor"></a><code><span><span class="keyword">val</span> token_to_litteral_string : <span><a href="#type-token_type">token_type</a> <span class="arrow">&#45;&gt;</span></span> string</span></code></div><div class="spec-doc"><p>Transforms the value of a token into a string</p></div></div><div class="odoc-spec"><div class="spec value" id="val-pretty_print" class="anchored"><a href="#val-pretty_print" class="anchor"></a><code><span><span class="keyword">val</span> pretty_print : <span><span class="xref-unresolved">Stdlib</span>.Format.formatter <span class="arrow">&#45;&gt;</span></span> <span><a href="#type-token_type">token_type</a> <span class="arrow">&#45;&gt;</span></span> unit</span></code></div><div class="spec-doc"><p>Pretty print a token</p></div></div><div class="odoc-spec"><div class="spec value" id="val-print_token_list" class="anchored"><a href="#val-print_token_list" class="anchor"></a><code><span><span class="keyword">val</span> print_token_list : <span><span><a href="#type-token_type">token_type</a> list</span> <span class="arrow">&#45;&gt;</span></span> unit</span></code></div><div class="spec-doc"><p>Prints a list of token</p></div></div></div></body></html>