texlive[53370] Master: simplebnf (11jan20)

commits+karl at tug.org commits+karl at tug.org
Sat Jan 11 23:12:45 CET 2020


Revision: 53370
          http://tug.org/svn/texlive?view=revision&revision=53370
Author:   karl
Date:     2020-01-11 23:12:45 +0100 (Sat, 11 Jan 2020)
Log Message:
-----------
simplebnf (11jan20)

Modified Paths:
--------------
    trunk/Master/tlpkg/bin/tlpkg-ctan-check
    trunk/Master/tlpkg/tlpsrc/collection-mathscience.tlpsrc

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/latex/simplebnf/
    trunk/Master/texmf-dist/doc/latex/simplebnf/LICENSE
    trunk/Master/texmf-dist/doc/latex/simplebnf/README.md
    trunk/Master/texmf-dist/doc/latex/simplebnf/simplebnf-doc.pdf
    trunk/Master/texmf-dist/doc/latex/simplebnf/simplebnf-doc.tex
    trunk/Master/texmf-dist/tex/latex/simplebnf/
    trunk/Master/texmf-dist/tex/latex/simplebnf/simplebnf.sty
    trunk/Master/tlpkg/tlpsrc/simplebnf.tlpsrc

Added: trunk/Master/texmf-dist/doc/latex/simplebnf/LICENSE
===================================================================
--- trunk/Master/texmf-dist/doc/latex/simplebnf/LICENSE	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/simplebnf/LICENSE	2020-01-11 22:12:45 UTC (rev 53370)
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright © 2019-2020 Jay Lee <jaeho.lee at snu.ac.kr>
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+the rights to use, copy, modify, merge, publish, distribute, sublicense,
+and/or sell copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
+OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Added: trunk/Master/texmf-dist/doc/latex/simplebnf/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/simplebnf/README.md	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/simplebnf/README.md	2020-01-11 22:12:45 UTC (rev 53370)
@@ -0,0 +1,11 @@
+# simplebnf
+simplebnf is a simple package to format Backus-Naur form. The package provides a simple way to format Backus-Naur form (BNF). It parses BNF expressions, possibly with annotations.
+
+## Documentation
+See the [simplebnf-doc.pdf](https://github.com/Zeta611/simplebnf/blob/master/simplebnf-doc.pdf) file.
+
+## Authors
+- Jay Lee <jaeho.lee at snu.ac.kr>
+
+## License
+simplebnf is available under the MIT license. See the [LICENSE](https://github.com/Zeta611/simplebnf/blob/master/LICENSE) file for more info.


Property changes on: trunk/Master/texmf-dist/doc/latex/simplebnf/README.md
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/simplebnf/simplebnf-doc.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/simplebnf/simplebnf-doc.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/simplebnf/simplebnf-doc.pdf	2020-01-11 22:12:12 UTC (rev 53369)
+++ trunk/Master/texmf-dist/doc/latex/simplebnf/simplebnf-doc.pdf	2020-01-11 22:12:45 UTC (rev 53370)

Property changes on: trunk/Master/texmf-dist/doc/latex/simplebnf/simplebnf-doc.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/simplebnf/simplebnf-doc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/simplebnf/simplebnf-doc.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/simplebnf/simplebnf-doc.tex	2020-01-11 22:12:45 UTC (rev 53370)
@@ -0,0 +1,82 @@
+\documentclass[a4paper]{article}
+
+\usepackage{fontspec}
+\setmainfont{Linux Libertine}
+\setsansfont{Libertinus Sans}
+\setmonofont{Inconsolata}
+
+\usepackage{hyperref}
+
+\usepackage{tcolorbox}
+\tcbuselibrary{listings,breakable}
+\tcbset{listing engine=listings,colframe=black,colback=white,size=small}
+\NewDocumentEnvironment {exampleside} {}
+  { \tcblisting{listing side text,righthand width=.4\textwidth} }
+  { \endtcblisting }
+
+\NewDocumentEnvironment { presentcommand } { b }
+  {%
+    \vspace*{0.5\baselineskip}\noindent\fbox{%
+      \begin{minipage}{\dimexpr\textwidth-2\fboxsep-2\fboxrule}
+        #1
+      \end{minipage}}\vspace*{0.5\baselineskip}
+  }
+  { }
+
+\NewDocumentCommand \cmd { m } { \texttt{\textbackslash#1} }
+\NewDocumentCommand \env { m m }
+  {
+    \texttt{%
+      \textbackslash begin\{#1\} \textrm{#2} %
+      \textbackslash end\{#1\}%
+    }%
+  }
+
+\usepackage{simplebnf}
+
+\title{%
+  \textsf{simplebnf} --- A simple package to format Backus-Naur form%
+  \footnote{This file describes v0.1.0.}}
+\author{Jay Lee\footnote{E-mail: %
+  \href{mailto:jaeho.lee at snu.ac.kr}{\texttt{jaeho.lee at snu.ac.kr}}}}
+\date{2019/12/23}
+
+\begin{document}
+\maketitle
+
+\begin{presentcommand}
+  \cmd{bnfexpr} \cmd{bnfannot}
+\end{presentcommand}
+The \cmd{bnfexpr} and the \cmd{bnfannot} commands are simply wrappers around
+\cmd{texttt} and \cmd{textit}, respectively.
+
+\begin{presentcommand}
+  \env{bnfgrammar}{text}
+\end{presentcommand}
+The \textit{term} argument of the \texttt{bnfgrammar} environment is the term
+to define a grammar.
+The text inside the environment should be formatted as:
+\begin{equation*}
+  \bnfexpr{term} \Coloneqq \langle\textit{keypairs}\rangle
+\end{equation*}
+where each pair of \textit{keypairs} represents an alternative syntactic form
+of the \textit{term} and its annotation, delimited with a colon(\verb/:/).
+If you don't need annotations, simply omit the colons and annotations
+altogether.
+
+A sample code and the result is shown below:
+\begin{exampleside}
+\begin{bnfgrammar}
+  v ::= n | $\lambda$x.e
+\end{bnfgrammar}
+
+\begin{bnfgrammar}
+  C ::=
+    []:      hole
+  | C\,e:    application 1
+  | v\,C:    application 2
+  | C\,+\,e: addition 1
+  | v\,+\,C: addition 2
+\end{bnfgrammar}
+\end{exampleside}
+\end{document}


Property changes on: trunk/Master/texmf-dist/doc/latex/simplebnf/simplebnf-doc.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/simplebnf/simplebnf.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/simplebnf/simplebnf.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/simplebnf/simplebnf.sty	2020-01-11 22:12:45 UTC (rev 53370)
@@ -0,0 +1,113 @@
+%%
+%% This is file `simplebnf.sty'.
+%%
+%% ---------------------------------------------------------------------------
+%% The simplebnf package --- A simple package to format Backus-Naur form
+%% Maintained by Jay Lee
+%% E-mail: jaeho.lee at snu.ac.kr
+%% Released under the MIT License.
+%% ---------------------------------------------------------------------------
+%%
+\RequirePackage{expl3,xparse}
+% mathtools is needed for the \Coloneqq simbol
+\RequirePackage{mathtools}
+\ProvidesExplPackage
+  {simplebnf}
+  {2019/12/23}
+  {0.1.0}
+  {A simple package to format Backus–Naur form}
+
+
+\cs_generate_variant:Nn \seq_set_split:Nnn {NVn}
+
+\tl_new:N \g__simplebnf_defeq_tl
+\tl_gset:Nn \g__simplebnf_defeq_tl { \ensuremath{\Coloneqq} }
+
+\tl_new:N \g__simplebnf_defor_tl
+\tl_gset:Nn \g__simplebnf_defor_tl { \ensuremath{|} }
+
+\seq_new:N \l__input_seq
+\tl_new:N \l__term_tl
+\tl_new:N \l__body_tl
+\tl_new:N \l__keypairs_tl
+\seq_new:N \l__keypairs_seq
+
+\NewDocumentCommand \bnfexpr { m } { \texttt { #1 } }
+\NewDocumentCommand \bnfannot { m } { \textit{ #1 } }
+
+\NewDocumentEnvironment { bnfgrammar } { +b }
+  {
+    % Store the term to define grammar in \l__term_tl and the
+    % (alternative form: annotion) keypairs in \l__keypairs_tl
+    \regex_split:nnN { ::= } { #1 } \l__input_seq
+    \seq_pop_left:NN \l__input_seq \l__term_tl
+    \seq_pop_left:NN \l__input_seq \l__keypairs_tl
+
+    % Store keypairs
+    \seq_set_split:NnV \l__keypairs_seq { | } \l__keypairs_tl
+
+    \begin{center}
+      \tl_set:Nn \l__table_tl
+        {
+          \begin{tabular}{lcll}
+            \bnfexpr { \l__term_tl } & \g__simplebnf_defeq_tl &
+        }
+
+      \bool_set_false:N \l_tmpa_bool
+
+      \seq_map_inline:Nn \l__keypairs_seq
+        {
+          \bool_if:NTF \l_tmpa_bool
+            { \tl_put_right:Nn \l__table_tl { \\ & \g__simplebnf_defor_tl & } }
+            { \bool_set_true:N \l_tmpa_bool }
+
+          \regex_split:nnNTF { : } { ##1 } \l_tmpa_seq
+            {
+              \seq_pop_left:NNT \l_tmpa_seq \l_tmpa_tl
+                {
+                  \tl_set:Nx \l_tmpa_tl { \bnfexpr { \l_tmpa_tl } }
+                  \tl_put_right:NV \l__table_tl \l_tmpa_tl
+                }
+
+              \tl_put_right:Nn \l__table_tl { & }
+
+              \seq_pop_left:NNT \l_tmpa_seq \l_tmpb_tl
+                {
+                  \tl_set:Nx \l_tmpb_tl { \bnfannot { \l_tmpb_tl } }
+                  \tl_put_right:NV \l__table_tl \l_tmpb_tl
+                }
+            }
+            {
+              \tl_put_right:Nn \l__table_tl { \bnfexpr { ##1 } & }
+            }
+        }
+
+      \tl_put_right:Nn \l__table_tl { \end{tabular} }
+      \tl_use:N \l__table_tl
+    \end{center}
+  }
+  { }
+
+%% The MIT License (MIT)
+%%
+%% Copyright © 2019-2020 Jay Lee <jaeho.lee at snu.ac.kr>
+%%
+%% Permission is hereby granted, free of charge, to any person obtaining
+%% a copy of this software and associated documentation files (the "Software"),
+%% to deal in the Software without restriction, including without limitation
+%% the rights to use, copy, modify, merge, publish, distribute, sublicense,
+%% and/or sell copies of the Software, and to permit persons to whom the
+%% Software is furnished to do so, subject to the following conditions:
+%%
+%% The above copyright notice and this permission notice shall be included
+%% in all copies or substantial portions of the Software.
+%%
+%% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+%% EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+%% OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+%% IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+%% DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+%% TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
+%% OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+%%
+%% End of file `simplebnf.sty'.


Property changes on: trunk/Master/texmf-dist/tex/latex/simplebnf/simplebnf.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/tlpkg/bin/tlpkg-ctan-check
===================================================================
--- trunk/Master/tlpkg/bin/tlpkg-ctan-check	2020-01-11 22:12:12 UTC (rev 53369)
+++ trunk/Master/tlpkg/bin/tlpkg-ctan-check	2020-01-11 22:12:45 UTC (rev 53370)
@@ -641,7 +641,7 @@
     show2e showcharinbox showdim showexpl showhyphens showlabels showtags
     shuffle
     sidecap sidenotes sides signchart silence
-    simple-resume-cv simple-thesis-dissertation simplecd simplecv
+    simple-resume-cv simple-thesis-dissertation simplebnf simplecd simplecv
     simpleinvoice simplekv simpleoptics simpler-wick simplewick
     simplified-latex simurgh
     sitem siunitx

Modified: trunk/Master/tlpkg/tlpsrc/collection-mathscience.tlpsrc
===================================================================
--- trunk/Master/tlpkg/tlpsrc/collection-mathscience.tlpsrc	2020-01-11 22:12:12 UTC (rev 53369)
+++ trunk/Master/tlpkg/tlpsrc/collection-mathscience.tlpsrc	2020-01-11 22:12:45 UTC (rev 53370)
@@ -163,6 +163,7 @@
 depend sesamanuel
 depend sfg
 depend shuffle
+depend simplebnf
 depend simpler-wick
 depend simplewick
 depend siunitx

Added: trunk/Master/tlpkg/tlpsrc/simplebnf.tlpsrc
===================================================================


More information about the tex-live-commits mailing list