Skip to content

Commit

Permalink
Deploying to gh-pages from @ d553949 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
zoranbosnjak committed Jul 22, 2024
0 parents commit 4e03ec2
Show file tree
Hide file tree
Showing 412 changed files with 790,198 additions and 0 deletions.
Empty file added .keepdir
Empty file.
Empty file added .nojekyll
Empty file.
132 changes: 132 additions & 0 deletions aspecs.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
<!doctype html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta charset="utf-8">

<title>Asterix specifications in structured format - aspecs</title>

<link rel="stylesheet" type="text/css" href="./css/default.css" />
<link rel="stylesheet" type="text/css" href="./css/syntax.css" />

<meta name="keywords" content="asterix" />
<meta name="description" content="asterix-specs - asterix specifications in structured format" />
</head>
<body>
<header>
<div id="logo">
Asterix specifications
</div>
<nav>
<a href="./index.html">Home</a>
<a href="./specs.html">Specifications</a>
<a href="./struct.html">Structure</a>
<a href="./syntax.html">Syntax</a>
<a href="./aspecs.html">Aspecs</a>
<a href="./faq.html">FAQ</a>
<a href="./source.html">Source</a>
</nav>
</header>

<main role="main">
<h1 id="aspecs">Aspecs</h1>
<p>Asterix conversion and validation tool is an integral part of this project.</p>
<p>Features:</p>
<ul>
<li>validate sources file</li>
<li>transparently convert from one format to another</li>
<li>convert from one format to itself (prettify definition file)</li>
<li>dump file as a list of items</li>
<li>show asterix definition signature (like a fingerprint, but not
depending on a particular file format)</li>
<li>generate documentation format</li>
</ul>
<p>Conversion process works in the following steps:</p>
<ol>
<li>parse input file to internal (abstract) structure</li>
<li>validate internal structure</li>
<li>generate required output format from internal structure</li>
</ol>
<p>Supported formats:</p>
<ul>
<li>custom <em>.ast</em> format</li>
<li>standard <em>.json</em> format</li>
</ul>
<p>It is possible to extend the converter to other formats
by implementing appropriate <code>encodeAsterix</code> and <code>decodeAsterix</code> functions.</p>
<p>Abstract <a href="./struct.html">internal structure</a> is the same for all formats.</p>
<h2 id="installation">Installation</h2>
<p>To install or upgrade asterix specifications tools, use one of the
following methods.</p>
<h3 id="static-binary-installation">Static binary installation</h3>
<p>Pre-build 64-bit linux binary is available to download from
<a href="./bin/aspecs-static">this link</a>.</p>
<ul>
<li>current version: <code>2.0.0</code></li>
<li>SHA256SUM: <code>a2d65cd8b918aa0c66100ec25f3a4a1758e1d79f97aaf19dfa71afa011dec3e6</code></li>
</ul>
<p>Download and copy the file to some location and set
file mode, for example under UbuntuOS:</p>
<div class="sourceCode" id="cb1"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">sudo</span> cp aspecs-static /usr/local/bin/aspecs</span>
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a><span class="fu">sudo</span> chmod 755 /usr/local/bin/aspecs</span>
<span id="cb1-3"><a href="#cb1-3" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb1-4"><a href="#cb1-4" aria-hidden="true" tabindex="-1"></a><span class="co"># verify installation</span></span>
<span id="cb1-5"><a href="#cb1-5" aria-hidden="true" tabindex="-1"></a><span class="ex">aspecs</span> <span class="at">--version</span></span></code></pre></div>
<h3 id="installation-via-nix-package-manager">Installation via <code>nix</code> package manager</h3>
<p>With active <a href="https://nixos.org/">nix</a> environment:</p>
<div class="sourceCode" id="cb2"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="bu">cd</span> aspecs</span>
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a><span class="ex">nix-build</span></span>
<span id="cb2-3"><a href="#cb2-3" aria-hidden="true" tabindex="-1"></a><span class="ex">nix-env</span> <span class="at">-i</span> <span class="va">$(</span><span class="fu">readlink</span> result<span class="va">)</span></span>
<span id="cb2-4"><a href="#cb2-4" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb2-5"><a href="#cb2-5" aria-hidden="true" tabindex="-1"></a><span class="co"># verify installation</span></span>
<span id="cb2-6"><a href="#cb2-6" aria-hidden="true" tabindex="-1"></a><span class="ex">aspecs</span> <span class="at">--version</span></span></code></pre></div>
<h2 id="usage">Usage</h2>
<div class="sourceCode" id="cb3"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="co"># show help</span></span>
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a><span class="ex">aspecs</span> <span class="at">--help</span></span>
<span id="cb3-3"><a href="#cb3-3" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb3-4"><a href="#cb3-4" aria-hidden="true" tabindex="-1"></a><span class="co"># validate a file (ast/json format)</span></span>
<span id="cb3-5"><a href="#cb3-5" aria-hidden="true" tabindex="-1"></a><span class="ex">aspecs</span> validate <span class="at">-f</span> input.ast <span class="at">--ast</span></span>
<span id="cb3-6"><a href="#cb3-6" aria-hidden="true" tabindex="-1"></a><span class="ex">aspecs</span> validate <span class="at">-f</span> input.json <span class="at">--json</span></span>
<span id="cb3-7"><a href="#cb3-7" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb3-8"><a href="#cb3-8" aria-hidden="true" tabindex="-1"></a><span class="co"># prettify ast file after editing, the file will be overwritten</span></span>
<span id="cb3-9"><a href="#cb3-9" aria-hidden="true" tabindex="-1"></a><span class="ex">aspecs</span> prettify input.ast <span class="at">--ast</span></span>
<span id="cb3-10"><a href="#cb3-10" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb3-11"><a href="#cb3-11" aria-hidden="true" tabindex="-1"></a><span class="co"># show definition fingerprint, for the same definitions</span></span>
<span id="cb3-12"><a href="#cb3-12" aria-hidden="true" tabindex="-1"></a><span class="co"># the fingerprint shall be the same, regardless of the format</span></span>
<span id="cb3-13"><a href="#cb3-13" aria-hidden="true" tabindex="-1"></a><span class="ex">aspecs</span> checksum <span class="at">-f</span> input.ast <span class="at">--ast</span></span>
<span id="cb3-14"><a href="#cb3-14" aria-hidden="true" tabindex="-1"></a><span class="ex">aspecs</span> checksum <span class="at">-f</span> input.json <span class="at">--json</span></span>
<span id="cb3-15"><a href="#cb3-15" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb3-16"><a href="#cb3-16" aria-hidden="true" tabindex="-1"></a><span class="co"># convert ast -&gt; json</span></span>
<span id="cb3-17"><a href="#cb3-17" aria-hidden="true" tabindex="-1"></a><span class="ex">aspecs</span> convert <span class="at">-f</span> input.ast <span class="at">--ast</span> <span class="at">--json</span> <span class="op">&gt;</span> out.json</span>
<span id="cb3-18"><a href="#cb3-18" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb3-19"><a href="#cb3-19" aria-hidden="true" tabindex="-1"></a><span class="co"># convert json -&gt; ast</span></span>
<span id="cb3-20"><a href="#cb3-20" aria-hidden="true" tabindex="-1"></a><span class="ex">aspecs</span> convert <span class="at">-f</span> input.json <span class="at">--json</span> <span class="at">--ast</span> <span class="op">&gt;</span> out.ast</span></code></pre></div>
<h2 id="development">Development</h2>
<p>Install nix package manager, clone repository</p>
<div class="sourceCode" id="cb4"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="ex">curl</span> <span class="at">-L</span> https://nixos.org/nix/install <span class="kw">|</span> <span class="fu">sh</span></span>
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a><span class="fu">git</span> clone https://github.com/zoranbosnjak/asterix-specs.git</span>
<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a><span class="bu">cd</span> asterix-specs/aspecs/</span></code></pre></div>
<p>(Re)build aspecs with <code>nix-build</code> and run it</p>
<div class="sourceCode" id="cb5"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="ex">nix-build</span></span>
<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a><span class="ex">./result/bin/aspecs</span> <span class="at">--help</span></span></code></pre></div>
<p>Use <code>nix-shell</code> environment</p>
<div class="sourceCode" id="cb6"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a><span class="ex">nix-shell</span></span>
<span id="cb6-2"><a href="#cb6-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb6-3"><a href="#cb6-3" aria-hidden="true" tabindex="-1"></a><span class="co"># monitor changes, auto rebuild on any source change</span></span>
<span id="cb6-4"><a href="#cb6-4" aria-hidden="true" tabindex="-1"></a><span class="ex">ghcid</span> <span class="st">&quot;--command=ghci -Wall </span><span class="va">$EXTENSIONS</span><span class="st"> -iother -ilib -iapp app/Main.hs&quot;</span></span>
<span id="cb6-5"><a href="#cb6-5" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb6-6"><a href="#cb6-6" aria-hidden="true" tabindex="-1"></a><span class="co"># run program without rebuild</span></span>
<span id="cb6-7"><a href="#cb6-7" aria-hidden="true" tabindex="-1"></a><span class="ex">runhaskell</span> <span class="va">$EXTENSIONS</span> <span class="at">-iother</span> <span class="at">-ilib</span> <span class="at">-iapp</span> app/Main <span class="at">--help</span></span>
<span id="cb6-8"><a href="#cb6-8" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb6-9"><a href="#cb6-9" aria-hidden="true" tabindex="-1"></a><span class="co"># (re)build with 'cabal' and run program</span></span>
<span id="cb6-10"><a href="#cb6-10" aria-hidden="true" tabindex="-1"></a><span class="ex">cabal</span> build</span>
<span id="cb6-11"><a href="#cb6-11" aria-hidden="true" tabindex="-1"></a><span class="fu">find</span> . <span class="at">-type</span> f <span class="at">-executable</span> <span class="kw">|</span> <span class="fu">grep</span> <span class="at">-v</span> <span class="st">&quot;\.so&quot;</span></span>
<span id="cb6-12"><a href="#cb6-12" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb6-13"><a href="#cb6-13" aria-hidden="true" tabindex="-1"></a><span class="bu">exit</span></span></code></pre></div>
</main>

<footer>
Fork this project on <a href="https://github.com/zoranbosnjak/asterix-specs">github</a>.
</footer>
</body>
</html>
Binary file added bin/aspecs
Binary file not shown.
Binary file added bin/aspecs-static
Binary file not shown.
14 changes: 14 additions & 0 deletions bin/to-pdf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#! /nix/store/yisjp6hkqc1qz8lmgnc0dklx0hgg9w2x-bash-5.2-p15/bin/bash -e
PATH=${PATH:+':'$PATH':'}
PATH=${PATH/':''/nix/store/pmilfw94g2zm3jfqw4a0wxfsh5zx5p92-pandoc-cli-3.1.9/bin'':'/':'}
PATH='/nix/store/pmilfw94g2zm3jfqw4a0wxfsh5zx5p92-pandoc-cli-3.1.9/bin'$PATH
PATH=${PATH#':'}
PATH=${PATH%':'}
export PATH
PATH=${PATH:+':'$PATH':'}
PATH=${PATH/':''/nix/store/9m7pcx0szcn18jhzh0fzcpd78fcvrgmx-texlive-combined-2022/bin'':'/':'}
PATH='/nix/store/9m7pcx0szcn18jhzh0fzcpd78fcvrgmx-texlive-combined-2022/bin'$PATH
PATH=${PATH#':'}
PATH=${PATH%':'}
export PATH
exec -a "$0" "/nix/store/hwdpqahs3r9fja25x32sk751irrq68n6-to-pdf/bin/.to-pdf-wrapped" "$@"
73 changes: 73 additions & 0 deletions css/default.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
body {
color: #2B332E;
background: #FFFFFF;
font-size: 16px;
font-size: 1.0rem;
max-width: 960px;
padding: 0px 80px 25px;
font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', sans-serif;
}

div#logo {
font-weight: bold;
text-decoration: none;
text-align: center;
padding: 0px 0px 10px;
}

header {
border-bottom: 0.2rem solid #000;
padding: 0px 0px 25px;
}

nav {
font-family: monospace;
text-align: center;
text-transform: uppercase;
}

a:link {
color: blue;
background-color: transparent;
text-decoration: underline;
}

A:visited {
color: blue;
background-color: transparent;
text-decoration: underline;
}

a:hover {
color: #CC3333;
background-color: transparent;
text-decoration: none;
}

footer {
text-align: right;
margin-top: 3rem;
padding: 1.2rem 0;
border-top: 0.2rem solid #000;
font-size: 0.8rem;
color: #555;
}

code {
background-color: rgb(250, 250, 250);
border: 1px solid rgb(200, 200, 200);
padding-left: 4px;
padding-right: 4px;
}

pre code {
display: block;
padding: 8px;
margin-bottom: 2em;
}

img {
max-width: 800px;
display: block;
}

61 changes: 61 additions & 0 deletions css/syntax.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
a.sourceLine { display: inline-block; line-height: 1.25; }
a.sourceLine { pointer-events: none; color: inherit; text-decoration: inherit; }
a.sourceLine:empty { height: 1.2em; }
.sourceCode { overflow: visible; }
code.sourceCode { white-space: pre; position: relative; }
div.sourceCode { margin: 1em 0; }
pre.sourceCode { margin: 0; }
@media screen {
div.sourceCode { overflow: auto; }
}
@media print {
code.sourceCode { white-space: pre-wrap; }
a.sourceLine { text-indent: -1em; padding-left: 1em; }
}
pre.numberSource a.sourceLine
{ position: relative; left: -4em; }
pre.numberSource a.sourceLine::before
{ content: attr(title);
position: relative; left: -1em; text-align: right; vertical-align: baseline;
border: none; pointer-events: all; display: inline-block;
-webkit-touch-callout: none; -webkit-user-select: none;
-khtml-user-select: none; -moz-user-select: none;
-ms-user-select: none; user-select: none;
padding: 0 4px; width: 4em;
color: #aaaaaa;
}
pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; }
div.sourceCode
{ }
@media screen {
a.sourceLine::before { text-decoration: underline; }
}
code span.al { color: #ff0000; font-weight: bold; } /* Alert */
code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
code span.at { color: #7d9029; } /* Attribute */
code span.bn { color: #40a070; } /* BaseN */
code span.bu { } /* BuiltIn */
code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
code span.ch { color: #4070a0; } /* Char */
code span.cn { color: #880000; } /* Constant */
code span.co { color: #60a0b0; font-style: italic; } /* Comment */
code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
code span.do { color: #ba2121; font-style: italic; } /* Documentation */
code span.dt { color: #902000; } /* DataType */
code span.dv { color: #40a070; } /* DecVal */
code span.er { color: #ff0000; font-weight: bold; } /* Error */
code span.ex { } /* Extension */
code span.fl { color: #40a070; } /* Float */
code span.fu { color: #06287e; } /* Function */
code span.im { } /* Import */
code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
code span.kw { color: #007020; font-weight: bold; } /* Keyword */
code span.op { color: #666666; } /* Operator */
code span.ot { color: #007020; } /* Other */
code span.pp { color: #bc7a00; } /* Preprocessor */
code span.sc { color: #4070a0; } /* SpecialChar */
code span.ss { color: #bb6688; } /* SpecialString */
code span.st { color: #4070a0; } /* String */
code span.va { color: #19177c; } /* Variable */
code span.vs { color: #4070a0; } /* VerbatimString */
code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
Loading

0 comments on commit 4e03ec2

Please sign in to comment.