stratego-shell — interpreters a Stratego program, from a script or interactively
d | --Include
The Stratego Shell is a bimodal interpreter for Stratego. It can work either in interactive or script mode. In the interactive mode, strategies can be entered at the command-line of the shell, and will always rewrite the current term. Shell-specific commands can be used to inspect the environment at any point in time.
In script mode, the interpreter is provided with a text file
containing a Stratego program (with
Stratego Shell script (with
In either mode, the initial current term can be supplied to
the interpreter with the
-i option. The
final current term will be written to the optional output
-o option), or the standard output.
The shell can be applied in a pipe.
Interpret the script in
is to start the interactive interpreter.
Interpret the Stratego program in
starting with the strategy
Execute one command,
cmd. This can
be any single strategy expression or interpreter command. It
can also be a series of expressions and commands, separated
;;. The series must not
end in a
--cmd, execute a series of commands
;;. The series
must be terminated by a
Add the directory
dir to the list
of directories to search for modules.
Common Input/Output Options
The input term given by the file name
In the absence of the
-i option, input
will be read from
The output will be written to the file given by the file name
In the absence of the
output will be written to
The output will be written in the binary (BAF) ATerm format.
ATerms in the BAF format require a lot less space than ones in the TAF format, but the Java ATerm library does not currently support baf ATerms. ATerms in the baf format is the preferred format of exchange between Stratego tools.
Common Debugging Options
Display usage information.
Keep intermediate results produced by the internal stages in the
pretty-printing process. This is only useful for debugging. A high
int indicates increased eagerness
for keeping intermediate results.
Default setting is 0, indicating that no intermediates will be kept.
Silent execution. Same as
Set verbosity level to numerical value
higher the number, the more information about pp-aterm's inner workings are
int can be set to either of the
following verbosity levels, given in increasing order of verbosity:
Displays the tool name and version.
To interpret the script in
against the term in
$stratego-shell -i tree.trm --script script.str
Please report bugs to
Copyright (C) 2002-2005 Eelco Visser
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.