The Escher binary is intended to be a general-purpose execution environment for Escher programs. It is invoked with two parameters:
escher -src SourceDirectory MainDirectiveThe following steps are performed upon invocation:
.escher
are parsed as Escher source files.
Circuits found therein are placed in the startup index, such that their location in the index
is the same as the path of their source file relative to the source directory, followed by their circuit names.
For instance, the source file a/b/c.escher
, containing:
CircuitName { … }Will be registered under the index address
a.b.c.CircuitName
.
SourceFile
reflex materializers,
located in the index at the path of their source file relative to the source directory. SourceFile
reflexes, when materialized, return an io.ReadCloser
for the content of the source file.
The following command, for instance, will generate the contents of this handbook and place it in the current working directory where it is invoked:
escher -src github.com/gocircuit/escher/src *handbook.main
The -src
can be omitted in favor of setting the ESCHER
environment variable.