cd src
chmod +x # only needed first time
./ape
This will print the current command line options.
APE is pre-processor to awk that handles:
- structs, with field accessed via a nested dot syntax;
- auto initialization of nested structures
- utilizing Gawk 4.0's nestes lists, plus indirect function calls
- unit tests
- multi-line comments containing markdown
- tests for for rogue locals
Also supproted in the ape
tool are convenient
short-cuts for:
- Vim editting
- Git pull and pushing
Further, the current release of ape
contains (a few) abstract
data types:
num
: numberssome
: stochastic sample of numbers
All you need is one file: ape
. Place in the same
directory as your *.ape
files. Then
chmod +x ape
If you check out this repo, then
cd src
./ape ok
will print many lines, the last of which should say :PERCENT 100
. e.g
# :PASSED 20 :FAILED 0 :PERCENT 100
Source file creation
./ape twins xxx
- Creates two source code files
xxx.ape
andxxxok.ape
. xxx.ape
loadsape0.ape
xxxok.ape
loadxxx.ape
and runs unit tests.
- Creates two source code files
Source file editting
./ape ed xxx.ape
- Edit
xxx.ape
withvim
using some convenient settings.
- Edit
Gitting
./ape pull
- Grab files from master
./ape push
- Git commit, then git push
Source file execution
./ape run xxx
- runs the file
xxx.ape
- runs the file
- XXX from standard input
- XXX from file name nput
Test suite execution
./ape ok xxx
- runs the file
xxxok.ape
, reports pass, fails
- runs the file
./ape ok
- runs all the
*ok.ape
files, reports pass, fails
- runs all the
Documentation
- XXX generate .md
- XXX generate .html (using grip... may incur github timeout restrictions)
ape
= the main routinesape0.ape
= core functionality (structs and unit tests) This file is auto-generated byape
if it does not exist.
xxx.ape
= your codexxxok.ape
= test scripts forxxx.ape
These two files can be auto-generated using the command
./ape twins xxx
.
./
= where to find.ape
source files;$Var
= where to store long-lived temoraries. Defaults to$Src/var
; If$Var
is in some version-controlled directory (e.g. git) best to exclude $Var from the files under version control (e.g. by adding the $Var pathname to.gitingore
);$Lib
= where to store generated.awk
files;$Doc
= where to store generated.md
files.
If $Var, $Lib, $Doc
do not exist, they are auto-generated by ape
.
Abstract data type xx
is stored in file xs.ape
, which contains an initialization
function:
function Xx(i, initarg) {
Object(i) # supertype initialization. Defaults to "Object"
}
function XxAdd(i, x) {
# do something to add "x" into "i"
}
Note the Camelcase for the function creation. Also, note the
convention that the operators for the abstract data type is XxAdd
is
an extended CamelCase.
XXX global