No walking baby nephews in the park
Sign in a park in a Michael Leunig cartoon
ℕ𝕠𝕞 example scripts
This folder contains some example scripts in the
ℕ𝕠𝕞 script language.
Scripts have the file extension “.pss”.
These examples can be run using the
interpreter and debugger (the “pep” interpreter) or by translating to
rust |
dart |
perl |
lua |
go |
java |
javascript |
ruby |
python |
tcl |
c
and then (maybe compiling and) running.
/eg/text.tohtml.pss transforms a “plain-text” (minimal mark-up) document
into html
/eg/sed.tojava.pss transpiles a gnu
SED script into the
JAVA language
(branch syntax with 't' etc is not supported because java has not [goto]
statement )
/eg/maths.tolatex.pss transforms arithmetic, symbolic and logical
expressions into printable
LATEX formulas.
/eg/exp.tolisp.pss transforms an arithmetic infix expression into
LISP This is a simpler and older version of the 2 scripts above
/eg/toybnf.pss translates simple
BNF type grammar rules into
ℕ𝕠𝕞 scripts. This is the basis for a bnf style parsing
and compiling language
/eg/natural.language.pss implements a limited natural language (English)
parser. I plan to expand this with a better 'phrase grammar'
/eg/tocfoot.tohtml.pss demonstrates creating a table of contents
and a footer (for footnotes) and using markers in the source document
to place the table of contents and footers (this uses [toc] and [foot]
as markers.
naming
.noself. in the filenames means that there is no self-translation or
self-help or self-testing in the script.
The scripts are often named for the format or language that they translate
to such as text.tohtml.pss or nom.tolatex.pss
ideas for example scripts
dictionary or glossary formatting:
A script to format a plain-test dictionary into html and
LATEX
using a standard dictionary format.
a drawing/animation language:
or invent a new drawing/animation/gaming language (getting ambitious which
has a slightly more sensible syntax than that of the “logo” language.
I started this in /eg/drawlang.pss which transpiles to python, but
I haven't continued.