The execute command is intended to execute a sequence of statemets. Statements are vertical bar separated algorithms introduced by the name, casts to specified type, or one can use a variable, file, string or integer constant, binded value, or set constructor. (The set constructor will in the future acompanied with constructor of other common structures.)
The execute and print commands are intended to evaluate a sequence of statemets. Statements are vertical bar separated algorithms introduced by the name, casts to specified type, or one can use a variable, file, string or integer constant, binded value, or set constructor. (The set constructor will in the future acompanied with constructor of other common structures.)
The syntax of execute comand is similar to the syntax of bash. In the simple case the sequence of statements is simply a sequence of algorithms and their parameters.
The syntax of execute and print comands is similar to the syntax of bash. In the simple case the sequence of statements is simply a sequence of algorithms and their parameters.
\begin{lstlisting}
execute string::Parse @Automaton "NFA a b
print string::Parse @Automaton "NFA a b
>0 0 1
1 - 2
<2 - -" | Determinize -
\end{lstlisting}
Result of a execute command will be printed to the console by default, but it can also be printed to a file and later read.
Result of a print command will be printed to the console, but result of execution can also be printed to a file and later read.
\begin{lstlisting}
execute string::Parse @Automaton "NFA a b
>0 0 1
1 - 2
<2 - -" | Determinize - > automaton.xml
execute < automaton.xml | Minimize -
print < automaton.xml | Minimize -
\end{lstlisting}
File reading is parametrized by some clauses, the argument inside the brackets is a specification of the file type, the argument after the colon is the specification of the content of the file, and arguments after at sign give template parameters is needed.
...
...
@@ -807,13 +803,13 @@ The string and raw types require the content specification to be set with type a
The use of the in\_redirect symbol is overloaded and allows the creation of subquery.
\begin{lstlisting}
execute Determinize <( string::Parse @Automaton "NFA a b
print Determinize <( string::Parse @Automaton "NFA a b
>0 0 1
1 - 2
<2 - -")
...
...
@@ -835,13 +831,7 @@ execute Determinize <( string::Parse @Automaton "NFA a b
>0 0 1
1 - 2
<2 - -" ) > \$dfa
execute Minimize \$dfa
\end{lstlisting}
Specifying no target file in the output redirection discarts the result.
\begin{lstlisting}
execute < automaton.xml >
print Minimize \$dfa
\end{lstlisting}
The command line interface can be exited with quit command that can also report exit status of the execution. The syntax of the quit is same as execute in that case, however only integer and boolean results are interpreted as exit status. Integer result is used directly, boolean value true is interpretted as 0 exit status and false as 1. The behavior matches the expected results of commands in unix like systems.