Doc: add link to dev-expr download page
This commit is contained in:
parent
8346e28340
commit
cf73b5c98d
@ -22,17 +22,23 @@ Expressions calculator
|
|||||||
|
|
||||||
toc::[]
|
toc::[]
|
||||||
|
|
||||||
#TODO: Work in progress (last update on 2024/05/09, 07:17 am)#
|
#TODO: Work in progress (last update on 2024/05/10, 06:52 a.m.)#
|
||||||
|
|
||||||
== Expr
|
== Expr
|
||||||
_Expr_ is a GO package capable of analysing, interpreting and calculating expressions.
|
_Expr_ is a GO package capable of analysing, interpreting and calculating expressions.
|
||||||
|
|
||||||
|
=== Concepts and terminology
|
||||||
|
#TODO#
|
||||||
|
|
||||||
|
image::expression-diagram.png[]
|
||||||
|
|
||||||
=== `dev-expr` test tool
|
=== `dev-expr` test tool
|
||||||
`dev-expr` is a simple program that can be used to evaluate expressions interactively. As its name suggests, it was created for testing purpose. In fact, beyond in additon to the automatic test suite based on the Go test framework, `dev-expr` provides an important aid for quickly testing of new features during their development.
|
`dev-expr` is a simple program that can be used to evaluate expressions interactively. As its name suggests, it was created for testing purpose. In fact, beyond in additon to the automatic test suite based on the Go test framework, `dev-expr` provides an important aid for quickly testing of new features during their development.
|
||||||
|
|
||||||
It cat work as a REPL, *R*ead-*E*xecute-*P*rint-*L*oop, or it can process expression acquired from files or standard input.
|
It cat work as a _REPL_, _**R**ead-**E**xecute-**P**rint-**L**oop_, or it can process expression acquired from files or standard input.
|
||||||
|
|
||||||
|
The program can be downloaded from https://git.portale-stac.it/go-pkg/-/packages/generic/dev-expr/[dev-expr].
|
||||||
|
|
||||||
The program in located in the _tools_ directory.
|
|
||||||
Here are some examples of execution.
|
Here are some examples of execution.
|
||||||
|
|
||||||
.Run `dev-expr` in REPL mode and ask for help
|
.Run `dev-expr` in REPL mode and ask for help
|
||||||
@ -103,11 +109,6 @@ Here are some examples of execution.
|
|||||||
<4> But operator, see <<_but_operator>>.
|
<4> But operator, see <<_but_operator>>.
|
||||||
<5> Multi-expression: the same result of the previous single expression but this it is obtained with two separated calculations.
|
<5> Multi-expression: the same result of the previous single expression but this it is obtained with two separated calculations.
|
||||||
|
|
||||||
=== Concepts and terminology
|
|
||||||
#TODO#
|
|
||||||
|
|
||||||
image::expression-diagram.png[]
|
|
||||||
|
|
||||||
== Data types
|
== Data types
|
||||||
_Expr_ supports numerical, string, relational, boolean expressions, and mixed-type lists.
|
_Expr_ supports numerical, string, relational, boolean expressions, and mixed-type lists.
|
||||||
|
|
||||||
|
@ -535,8 +535,8 @@ pre.rouge .ss {
|
|||||||
<ul class="sectlevel1">
|
<ul class="sectlevel1">
|
||||||
<li><a href="#_expr">1. Expr</a>
|
<li><a href="#_expr">1. Expr</a>
|
||||||
<ul class="sectlevel2">
|
<ul class="sectlevel2">
|
||||||
<li><a href="#_dev_expr_test_tool">1.1. <code>dev-expr</code> test tool</a></li>
|
<li><a href="#_concepts_and_terminology">1.1. Concepts and terminology</a></li>
|
||||||
<li><a href="#_concepts_and_terminology">1.2. Concepts and terminology</a></li>
|
<li><a href="#_dev_expr_test_tool">1.2. <code>dev-expr</code> test tool</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li><a href="#_data_types">2. Data types</a>
|
<li><a href="#_data_types">2. Data types</a>
|
||||||
@ -545,7 +545,7 @@ pre.rouge .ss {
|
|||||||
<li><a href="#_fractions">2.2. Fractions</a></li>
|
<li><a href="#_fractions">2.2. Fractions</a></li>
|
||||||
<li><a href="#_strings">2.3. Strings</a></li>
|
<li><a href="#_strings">2.3. Strings</a></li>
|
||||||
<li><a href="#_boolean">2.4. Boolean</a></li>
|
<li><a href="#_boolean">2.4. Boolean</a></li>
|
||||||
<li><a href="#_list">2.5. List</a></li>
|
<li><a href="#_lists">2.5. Lists</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li><a href="#_dictionaries">3. Dictionaries</a></li>
|
<li><a href="#_dictionaries">3. Dictionaries</a></li>
|
||||||
@ -579,7 +579,7 @@ pre.rouge .ss {
|
|||||||
<div class="sectionbody">
|
<div class="sectionbody">
|
||||||
<!-- toc disabled -->
|
<!-- toc disabled -->
|
||||||
<div class="paragraph">
|
<div class="paragraph">
|
||||||
<p><mark>TODO: Work in progress (last update on 2024/05/09, 07:17 am)</mark></p>
|
<p><mark>TODO: Work in progress (last update on 2024/05/10, 06:52 a.m.)</mark></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -590,16 +590,29 @@ pre.rouge .ss {
|
|||||||
<p><em>Expr</em> is a GO package capable of analysing, interpreting and calculating expressions.</p>
|
<p><em>Expr</em> is a GO package capable of analysing, interpreting and calculating expressions.</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="sect2">
|
<div class="sect2">
|
||||||
<h3 id="_dev_expr_test_tool"><a class="anchor" href="#_dev_expr_test_tool"></a><a class="link" href="#_dev_expr_test_tool">1.1. <code>dev-expr</code> test tool</a></h3>
|
<h3 id="_concepts_and_terminology"><a class="anchor" href="#_concepts_and_terminology"></a><a class="link" href="#_concepts_and_terminology">1.1. Concepts and terminology</a></h3>
|
||||||
|
<div class="paragraph">
|
||||||
|
<p><mark>TODO</mark></p>
|
||||||
|
</div>
|
||||||
|
<div class="imageblock">
|
||||||
|
<div class="content">
|
||||||
|
<img src="expression-diagram.png" alt="expression diagram">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="sect2">
|
||||||
|
<h3 id="_dev_expr_test_tool"><a class="anchor" href="#_dev_expr_test_tool"></a><a class="link" href="#_dev_expr_test_tool">1.2. <code>dev-expr</code> test tool</a></h3>
|
||||||
<div class="paragraph">
|
<div class="paragraph">
|
||||||
<p><code>dev-expr</code> is a simple program that can be used to evaluate expressions interactively. As its name suggests, it was created for testing purpose. In fact, beyond in additon to the automatic test suite based on the Go test framework, <code>dev-expr</code> provides an important aid for quickly testing of new features during their development.</p>
|
<p><code>dev-expr</code> is a simple program that can be used to evaluate expressions interactively. As its name suggests, it was created for testing purpose. In fact, beyond in additon to the automatic test suite based on the Go test framework, <code>dev-expr</code> provides an important aid for quickly testing of new features during their development.</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="paragraph">
|
<div class="paragraph">
|
||||||
<p>It cat work as a REPL, *R*ead-*E*xecute-*P*rint-*L*oop, or it can process expression acquired from files or standard input.</p>
|
<p>It cat work as a <em>REPL</em>, <em><strong>R</strong>ead-<strong>E</strong>xecute-<strong>P</strong>rint-<strong>L</strong>oop</em>, or it can process expression acquired from files or standard input.</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="paragraph">
|
<div class="paragraph">
|
||||||
<p>The program in located in the <em>tools</em> directory.
|
<p>The program can be downloaded from <a href="https://git.portale-stac.it/go-pkg/-/packages/generic/dev-expr/">dev-expr</a>.</p>
|
||||||
Here are some examples of execution.</p>
|
</div>
|
||||||
|
<div class="paragraph">
|
||||||
|
<p>Here are some examples of execution.</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="listingblock">
|
<div class="listingblock">
|
||||||
<div class="title">Run <code>dev-expr</code> in REPL mode and ask for help</div>
|
<div class="title">Run <code>dev-expr</code> in REPL mode and ask for help</div>
|
||||||
@ -697,17 +710,6 @@ Here are some examples of execution.</p>
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="sect2">
|
|
||||||
<h3 id="_concepts_and_terminology"><a class="anchor" href="#_concepts_and_terminology"></a><a class="link" href="#_concepts_and_terminology">1.2. Concepts and terminology</a></h3>
|
|
||||||
<div class="paragraph">
|
|
||||||
<p><mark>TODO</mark></p>
|
|
||||||
</div>
|
|
||||||
<div class="imageblock">
|
|
||||||
<div class="content">
|
|
||||||
<img src="expression-diagram.png" alt="expression diagram">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="sect1">
|
<div class="sect1">
|
||||||
@ -791,14 +793,14 @@ Here are some examples of execution.</p>
|
|||||||
<div class="sect2">
|
<div class="sect2">
|
||||||
<h3 id="_fractions"><a class="anchor" href="#_fractions"></a><a class="link" href="#_fractions">2.2. Fractions</a></h3>
|
<h3 id="_fractions"><a class="anchor" href="#_fractions"></a><a class="link" href="#_fractions">2.2. Fractions</a></h3>
|
||||||
<div class="paragraph">
|
<div class="paragraph">
|
||||||
<p><em>Expr</em> also suports fractions. Fraction literals are made with tow integers separated by a vertical bar <code>|</code>.</p>
|
<p><em>Expr</em> also supports fractions. Fraction literals are made with two integers separated by a vertical bar <code>|</code>.</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="paragraph">
|
<div class="paragraph">
|
||||||
<div class="title">Examples</div>
|
<div class="title">Examples</div>
|
||||||
<p><code>>>></code> <code class="blue">1 | 2</code><br>
|
<p><code>>>></code> <code class="blue">1 | 2</code><br>
|
||||||
<code class="green">1|2</code><br>
|
<code class="green">1|2</code><br>
|
||||||
<code>>>></code> <code class="blue">4|6</code><br>
|
<code>>>></code> <code class="blue">4|6</code><br>
|
||||||
<code class="green">2|3</code> <em class="gray">Fractions are always reduced to theri lowest terms</em><br>
|
<code class="green">2|3</code> <em class="gray">Fractions are always reduced to their lowest terms</em><br>
|
||||||
<code>>>></code> <code class="blue">1|2 + 2|3</code><br>
|
<code>>>></code> <code class="blue">1|2 + 2|3</code><br>
|
||||||
<code class="green">7|6</code><br>
|
<code class="green">7|6</code><br>
|
||||||
<code>>>></code> <code class="blue">1|2 * 2|3</code><br>
|
<code>>>></code> <code class="blue">1|2 * 2|3</code><br>
|
||||||
@ -1003,7 +1005,7 @@ Here are some examples of execution.</p>
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="sect2">
|
<div class="sect2">
|
||||||
<h3 id="_list"><a class="anchor" href="#_list"></a><a class="link" href="#_list">2.5. List</a></h3>
|
<h3 id="_lists"><a class="anchor" href="#_lists"></a><a class="link" href="#_lists">2.5. Lists</a></h3>
|
||||||
<div class="paragraph">
|
<div class="paragraph">
|
||||||
<p><em>Expr</em> supports list of mixed-type values, also specified by normal expressions.</p>
|
<p><em>Expr</em> supports list of mixed-type values, also specified by normal expressions.</p>
|
||||||
</div>
|
</div>
|
||||||
@ -1048,6 +1050,33 @@ Here are some examples of execution.</p>
|
|||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
<div class="paragraph">
|
||||||
|
<p>The items of array can be accessed using the dot <code>.</code> operator.</p>
|
||||||
|
</div>
|
||||||
|
<div class="listingblock">
|
||||||
|
<div class="title">Item access syntax</div>
|
||||||
|
<div class="content">
|
||||||
|
<pre class="rouge highlight"><code data-lang="bnf"><item> ::= <list-expr>"."<index-expr></code></pre>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="listingblock">
|
||||||
|
<div class="title">Items of list</div>
|
||||||
|
<div class="content">
|
||||||
|
<pre class="rouge highlight"><code data-lang="go"><span class="s">`>>>`</span> <span class="p">[</span><span class="n">blue</span><span class="p">]</span><span class="s">`[1,2,3].1`</span>
|
||||||
|
<span class="p">[</span><span class="n">green</span><span class="p">]</span><span class="s">`2`</span>
|
||||||
|
<span class="s">`>>>`</span> <span class="p">[</span><span class="n">blue</span><span class="p">]</span><span class="s">`list=[1,2,3]; list.1`</span>
|
||||||
|
<span class="p">[</span><span class="n">green</span><span class="p">]</span><span class="s">`2`</span>
|
||||||
|
<span class="s">`>>>`</span> <span class="p">[</span><span class="n">blue</span><span class="p">]</span><span class="s">`["one","two","three"].1`</span>
|
||||||
|
<span class="p">[</span><span class="n">green</span><span class="p">]</span><span class="s">`two`</span>
|
||||||
|
<span class="s">`>>>`</span> <span class="p">[</span><span class="n">blue</span><span class="p">]</span><span class="s">`list=["one","two","three"]; list.(2-1)`</span>
|
||||||
|
<span class="p">[</span><span class="n">green</span><span class="p">]</span><span class="s">`two`</span>
|
||||||
|
<span class="s">`>>>`</span> <span class="p">[</span><span class="n">blue</span><span class="p">]</span><span class="s">`list.(-1)`</span>
|
||||||
|
<span class="p">[</span><span class="n">green</span><span class="p">]</span><span class="s">`three`</span>
|
||||||
|
<span class="s">`>>>`</span> <span class="p">[</span><span class="n">blue</span><span class="p">]</span><span class="s">`list.(-1)`</span>
|
||||||
|
<span class="p">[</span><span class="n">green</span><span class="p">]</span><span class="s">`three`</span>
|
||||||
|
<span class="s">`>>>`</span> <span class="p">[</span><span class="n">blue</span><span class="p">]</span><span class="s">`list.(10)`</span></code></pre>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -1461,7 +1490,7 @@ The value on the left side of <code class="blue">=</code> must be an identifier.
|
|||||||
</div>
|
</div>
|
||||||
<div id="footer">
|
<div id="footer">
|
||||||
<div id="footer-text">
|
<div id="footer-text">
|
||||||
Last updated 2024-05-09 07:18:01 +0200
|
Last updated 2024-05-10 06:38:03 +0200
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
Loading…
Reference in New Issue
Block a user