AlgoML
FR

Command-line generator

Generate code from a terminal, a script or a CI pipeline.

Usage

algoml-generate <file.aml> <output-folder>

On Windows with the ZIP or MSI package, the command is algoml-generate.bat. With the portable EXE, it is algoml-generator.exe.

The generated file is named after the algorithm: Algorithm Gcd with language C gives Gcd.c, with language JAVA gives Gcd.java, with language PYTHON gives Gcd.py.

Examples

algoml-generate gcd.aml .
algoml-generate exercises/loops.aml build

Generate the three languages

The language comes from the language line of the file. To get all the versions from one file, change that line and generate again. In a shell:

for lang in C JAVA PYTHON; do
mkdir -p out/$lang
sed "s/^language .*/language $lang/" gcd.aml > out/$lang/gcd.aml
algoml-generate out/$lang/gcd.aml out/$lang
done

Exit code

The command returns 0 when the file was generated, and another value when the file has errors. Scripts and pipelines can rely on it.

Report a problem with this page