Skip to content
Snippets Groups Projects
Commit 04ee7f15 authored by Jan Trávníček's avatar Jan Trávníček
Browse files

update documentation

parent 3d2b1cdd
No related branches found
No related tags found
1 merge request!111Merge jt
Pipeline #53398 passed with warnings
......@@ -22,12 +22,12 @@ for key in ${!arr[@]}; do
echo '\section{'${arr[${key}]}'}'
echo "$key" | tr ',' '\n' | while read group
do
../../debug/aql2/aql2 -q 'introspect algorithms '"$group"'::' | sed 's/<object::Object>//g' | while read algorithm
../../debug/aql2/aql2 -c 'introspect algorithms '"$group"'::' | sed 's/<object::Object>//g' | while read algorithm
do
echo "$algorithm" | sed 's/_/\\_/g'
echo
echo '\begin{lstlisting}'
../../debug/aql2/aql2 -q 'introspect overloads '"$algorithm" | sed 's/ >/>/g' | sed 's/std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>/std::string/g' | sed 's/, ext::less<void>//g' | sed 's/, std::allocator<object::Object>//g' | sed 's/, std::allocator<ext::pair<object::Object, object::Object>>//g' | sed 's/, std::allocator<unsigned int>//g' | sed 's/, std::allocator<unsigned long>//g' | sed 's/, std::allocator<int>//g' | sed 's/, std::allocator<std::pair<object::Object const, unsigned long>>//g' | sed 's/, std::allocator<common::ranked_symbol<object::Object, unsigned int>>//g' | sed 's/, std::allocator<std::pair<object::Object const, object::Object>>//g' | sed 's/, std::allocator<std::pair<common::ranked_symbol<object::Object, unsigned int> const, unsigned long>>//g' | sed 's/, std::allocator<std::pair<node::Node const, int>>//g' | sed 's/, std::allocator<ext::pair<long, long>>//g' | sed 's/, std::allocator<std::pair<object::Object const, double>>//g' | sed 's/, std::allocator<std::pair<ext::pair<long, long> const, double>>//g' | sed 's/, std::allocator<std::pair<object::Object const, ext::map<object::Object, double>>>//g' | sed 's/, std::allocator<std::pair<node::Node const, ext::unordered_map<node::Node, int, std::hash<node::Node>, std::equal_to<node::Node>>>>//g' | sed 's/, std::allocator<std::pair<node::Node, node::Node>>//g' | sed 's/, std::allocator<std::pair<ext::pair<long, long> const, ext::map<ext::pair<long, long>, double>>>//g' | sed 's/, std::allocator<ext::variant<object::Object, object::Object>>//g' | sed 's/, std::allocator<ext::variant<object::Object, object::Object>>//g' | sed 's/, std::allocator<ext::vector<ext::variant<object::Object, object::Object>>>//g' | sed 's/, std::allocator<sax::Token>//g' | sed 's/, std::allocator<std::pair<std::pair<object::Object, object::Object> const, ext::map<object::Object, object::Object>>>//g' | sed 's/, std::allocator<std::pair<object::Object const, ext::set<ext::vector<ext::variant<object::Object, object::Object>>>>>//g' | sed 's/, std::allocator<ext::set<object::Object>>//g' | sed 's/, std::allocator<ext::map<std::pair<object::Object, object::Object>, ext::map<object::Object, object::Object>>>//g' | sed 's/, std::allocator<ext::vector<ext::set<object::Object>>>//g' | sed 's/, std::hash<node::Node>, std::equal_to<node::Node>//g' | sed 's/, std::allocator<string::LinearString<object::Object>>//g' | sed 's/, std::hash<std::pair<node::Node, node::Node>>, std::equal_to<std::pair<node::Node, node::Node>>//g'
../../debug/aql2/aql2 -c 'introspect overloads '"$algorithm" | sed 's/ >/>/g' | sed 's/std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>/std::string/g' | sed 's/, ext::less<void>//g' | sed 's/, std::allocator<object::Object>//g' | sed 's/, std::allocator<ext::pair<object::Object, object::Object>>//g' | sed 's/, std::allocator<unsigned int>//g' | sed 's/, std::allocator<unsigned long>//g' | sed 's/, std::allocator<int>//g' | sed 's/, std::allocator<std::pair<object::Object const, unsigned long>>//g' | sed 's/, std::allocator<common::ranked_symbol<object::Object, unsigned int>>//g' | sed 's/, std::allocator<std::pair<object::Object const, object::Object>>//g' | sed 's/, std::allocator<std::pair<common::ranked_symbol<object::Object, unsigned int> const, unsigned long>>//g' | sed 's/, std::allocator<std::pair<node::Node const, int>>//g' | sed 's/, std::allocator<ext::pair<long, long>>//g' | sed 's/, std::allocator<std::pair<object::Object const, double>>//g' | sed 's/, std::allocator<std::pair<ext::pair<long, long> const, double>>//g' | sed 's/, std::allocator<std::pair<object::Object const, ext::map<object::Object, double>>>//g' | sed 's/, std::allocator<std::pair<node::Node const, ext::unordered_map<node::Node, int, std::hash<node::Node>, std::equal_to<node::Node>>>>//g' | sed 's/, std::allocator<std::pair<node::Node, node::Node>>//g' | sed 's/, std::allocator<std::pair<ext::pair<long, long> const, ext::map<ext::pair<long, long>, double>>>//g' | sed 's/, std::allocator<ext::variant<object::Object, object::Object>>//g' | sed 's/, std::allocator<ext::variant<object::Object, object::Object>>//g' | sed 's/, std::allocator<ext::vector<ext::variant<object::Object, object::Object>>>//g' | sed 's/, std::allocator<sax::Token>//g' | sed 's/, std::allocator<std::pair<std::pair<object::Object, object::Object> const, ext::map<object::Object, object::Object>>>//g' | sed 's/, std::allocator<std::pair<object::Object const, ext::set<ext::vector<ext::variant<object::Object, object::Object>>>>>//g' | sed 's/, std::allocator<ext::set<object::Object>>//g' | sed 's/, std::allocator<ext::map<std::pair<object::Object, object::Object>, ext::map<object::Object, object::Object>>>//g' | sed 's/, std::allocator<ext::vector<ext::set<object::Object>>>//g' | sed 's/, std::hash<node::Node>, std::equal_to<node::Node>//g' | sed 's/, std::allocator<string::LinearString<object::Object>>//g' | sed 's/, std::hash<std::pair<node::Node, node::Node>>, std::equal_to<std::pair<node::Node, node::Node>>//g'
echo '\end{lstlisting}'
done
done
......
......@@ -625,9 +625,25 @@ It is also possible to use gui. Use the following command extra/docker/docker-ag
 
This chapter mostly focuses on the description of the current status of the command line interface so-called aql. The command line interface was created to replace the interface represented by multiple binaries. The command line interface uses the abstraction module and registered algorithms. The algorithms are available to be called with appropriate arguments. The language of the command line interface is similar to bash, featuring subqueries and pipes.
 
\section{Execution parameters}
The query language shell binary accepts the following parameters:
\begin{description}
\item [-c] allows execution of a single command
\item [-f] executes commands from a file
\item [-e] sets an enviroment variable
\item [-i] open interactive mode
\end{description}
The default behavior of the shell binary is to open the interactive mode. The default behavior is disabled if any of -c or -f is specifies. The shell binary will stay in interactive mode if -i is used with -c or -f parameter.
The -c, -f and -i parameters are executed in order of apperance. The environment variables are set up before any command is executed.
Any quit command executed from parameter, a file, or from interactive shell stops the complete sequence of execution plan.
\section{Language description}
 
The language is described by syntax similar to EBNF. The grammar's initial symbol is 'parse'. The terminal symbols are in uppercase, nonterminals in lowercase. The terminal symbols starting with KW_ prefix represent nonreserved keywords of values equal to what is after the underscore. Integer is a sequence of digits; identifier is a letter followed by letters and digits and string is double-quoted character sequence. The terminal symbol end is a special terminal symbol representing the end of the input.
The language is described by syntax similar to EBNF. The grammar's initial symbol is 'parse'. The terminal symbols are in uppercase, nonterminals in lowercase. The terminal symbols starting with KW\_ prefix represent nonreserved keywords of values equal to what is after the underscore. Integer is a sequence of digits; identifier is a letter followed by letters and digits and string is double-quoted character sequence. The terminal symbol end is a special terminal symbol representing the end of the input.
 
\begin{lstlisting}
arg
......@@ -890,17 +906,56 @@ execute cli::builtin::ReadFile ../examples2/automaton/DFA.txt | string::Parse @
\section{Command line execution}
 
\begin{lstlisting}
./aql2 -p input=../examples2/automaton/DFA.txt -q 'execute cli::builtin::ReadFile #input# > $in' -q 'execute string::Parse @ automaton::Automaton ^ $in'
./aql2 -e input=../examples2/automaton/DFA.txt -c 'execute cli::builtin::ReadFile #input# > $in' -c 'execute string::Parse @ automaton::Automaton ^ $in'
\end{lstlisting}
 
\noindent
\begin{lstlisting}
./aql2 -q 'execute automaton::simplify::efficient::EpsilonRemoverIncoming <#stdin | automaton::determinize::Determinize - | automaton::simplify::Trim - | automaton::simplify::Minimize - | automaton::simplify::Normalize - > #stdout'
./aql2 -c 'execute automaton::simplify::efficient::EpsilonRemoverIncoming <#stdin | automaton::determinize::Determinize - | automaton::simplify::Trim - | automaton::simplify::Minimize - | automaton::simplify::Normalize - > #stdout'
\end{lstlisting}
 
\noindent
\begin{lstlisting}
echo 'a + a' | ./aql2 -q 'execute cli::builtin::ReadFile \#stdin | string::Parse @ regexp::RegExp ^ - | regexp::convert::ToAutomatonGlushkov (UnboundedRegExp) -'
echo 'a + a' | ./aql2 -c 'execute cli::builtin::ReadFile \#stdin | string::Parse @ regexp::RegExp ^ - | regexp::convert::ToAutomatonGlushkov (UnboundedRegExp) -'
\end{lstlisting}
\section{Execution parameters}
test.aql:
\begin{lstlisting}
execute string::Parse @Automaton "
DFA 0 1
<>0 0 0" > $dfa
execute "f1"
execute "f2"
\end{lstlisting}
\begin{lstlisting}
$ aql2 -c "execute 1" -c "execute 2" -f test.aql ; echo "retval -> $?"
1
2
f1
f2
retval -> 0
\end{lstlisting}
\begin{lstlisting}
$ aql2 -c "execute 1" -c "execute 2" -f test.aql -i ; echo "retval -> $?"
1
2
f1
f2
> execute "i"
i
> <EOF>
retval -> 0
\end{lstlisting}
\begin{lstlisting}
$ aql2 -c "execute 1" -c "quit 55" -f test.aql -i ; echo "retval -> $?"
1
retval -> 55
\end{lstlisting}
 
\backmatter
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment