<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Parser (libabsolute.Libabsolute.Parser)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../../odoc.support/odoc.css"/><meta name="generator" content="odoc 2.4.0"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../odoc.support/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">libabsolute</a> &#x00BB; <a href="../index.html">Libabsolute</a> &#x00BB; Parser</nav><header class="odoc-preamble"><h1>Module <code><span>Libabsolute.Parser</span></code></h1><p>This module defines several parsing utilities</p></header><div class="odoc-content"><div class="odoc-spec"><div class="spec exception anchored" id="exception-Syntax_error"><a href="#exception-Syntax_error" class="anchor"></a><code><span><span class="keyword">exception</span> </span><span><span class="exception">Syntax_error</span> <span class="keyword">of</span> string</span></code></div><div class="spec-doc"><p>Exception raised by parse functions when the input is syntactically invalid.</p></div></div><div class="odoc-spec"><div class="spec exception anchored" id="exception-Semantic_error"><a href="#exception-Semantic_error" class="anchor"></a><code><span><span class="keyword">exception</span> </span><span><span class="exception">Semantic_error</span> <span class="keyword">of</span> string</span></code></div><div class="spec-doc"><p>Exception raised by check functions when the input is semantically invalid</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-semantic_check"><a href="#val-semantic_check" class="anchor"></a><code><span><span class="keyword">val</span> semantic_check : <span><a href="../Csp/index.html#type-t">Csp.t</a> <span class="arrow">&#45;&gt;</span></span> unit</span></code></div><div class="spec-doc"><p>Check that no unbound variables appear, that domains are valid and function calls respect the arity.</p><ul class="at-tags"><li class="raises"><span class="at-tag">raises</span> <code>[Semantic_error]</code> <p>if one of the above conditions is violated</p></li></ul></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-expr"><a href="#val-expr" class="anchor"></a><code><span><span class="keyword">val</span> expr : <span>string <span class="arrow">&#45;&gt;</span></span> <a href="../Expr/index.html#type-t">Expr.t</a></span></code></div><div class="spec-doc"><p>Parses a string representation of a numeric expression.</p><ul class="at-tags"><li class="raises"><span class="at-tag">raises</span> <code>[Syntax_error]</code> <p>when the input is syntactically invalid</p></li></ul></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-constr"><a href="#val-constr" class="anchor"></a><code><span><span class="keyword">val</span> constr : <span>string <span class="arrow">&#45;&gt;</span></span> <a href="../Constraint/index.html#type-t">Constraint.t</a></span></code></div><div class="spec-doc"><p>Parses a string representation of a constraint.</p><ul class="at-tags"><li class="raises"><span class="at-tag">raises</span> <code>[Syntax_error]</code> <p>when the input is syntactically invalid</p></li></ul></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-file"><a href="#val-file" class="anchor"></a><code><span><span class="keyword">val</span> file : <span><span class="optlabel">?check</span>:bool <span class="arrow">&#45;&gt;</span></span> <span>string <span class="arrow">&#45;&gt;</span></span> <a href="../Csp/index.html#type-t">Csp.t</a></span></code></div><div class="spec-doc"><p>parses a <code>.abs</code> file and builds the corresponding problem. Raises <code>Syntax_error</code> when the input is syntactically invalid and <code>Semantic_error</code> when the input makes no sense (e.g unbound variable). When check is set to false, no semantic check is performed</p></div></div></div></body></html>
