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

update user doc

parent c6bc1049
No related branches found
No related tags found
1 merge request!111Merge jt
......@@ -206,13 +206,13 @@ Besides using algorithms to manipulate data, the datatypes allow casting when ap
 
The user interaction with the library is through a built-in interactive command line interface or a graphical interface.
 
The command line interface binary allows interaction with all algorithms through an interactive command line interface. The syntax of the language is similar to shell known from Unix operating systems. Internally it handles the passing of algorithm results to algorithm parameters directly without any transformation or manipulation. Such an approach allows the fastest interpretation of the algorithm interconnection. Even though the command line interface tries to hide some implementation details, a user can feel the fact that the implementation language of the library is c++ in some cases. For example, the command line interface is aware of datatypes and it is also unable to handle templates (used to design datatypes and algorithms) otherwise than statically. This, however, does not influence the overall functionality.
The command line interface \emph{aql2} binary allows interaction with all algorithms through an interactive command line interface. The syntax of the language is similar to shell known from Unix operating systems. Internally it handles the passing of algorithm's results to other algorithm's parameters directly without any transformation or manipulation. Such an approach allows the fastest interpretation of the algorithm interconnection. Even though the command line interface tries to hide some implementation details, a user can feel the fact that the implementation language of the library is C++ in some cases. For example, the command line interface is aware of datatypes and it is also unable to handle templates (used to design datatypes and algorithms) otherwise than statically. This, however, does not influence the overall functionality.
 
The command line interface binary at first automatically loads existing datatypes and algorithm provided by the linked library. The command line interface also provides load and unload command to load and unload arbitrary library which can contribute to currently available datatypes and algorithms.
The command line interface binary at first automatically loads existing datatypes and algorithm provided by the linked libraries. The command line interface also provides a load and an unload command to load and unload an arbitrary library which can contribute to currently available datatypes and algorithms.
 
The command line interface is planned to be extended to support some procedural like language which may cause a drop of backward compatibility.
 
A limited graphical interface allowing to design complex algorithm is also provided. The limitation is in the number of available algorithms, which is a static subset of all algorithms. Currently, the set is limited to algorithms manipulating automata, grammars, regexps. The graphical interface is planned to be extended to support all registered algorithm similar to the command line interface.
A limited graphical interface \emph{agui2} allowing to design complex algorithm is also provided. The limitation is in the number of available algorithms, which is a static subset of all algorithms. Currently, the set is limited to algorithms manipulating automata, grammars, regexps. The graphical interface is planned to be extended to support all registered algorithm similar to the command line interface.
 
The toolkit is extensible and as long as the added datatype or algorithm connects itself to already existing code via casts or conversion algorithms, the extension can benefit from features already implemented.
\mainmatter
......@@ -627,7 +627,7 @@ This chapter mostly focuses on the description of the current status of the comm
 
\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. Terminal symbols starting with KW\_ prefix represent nonreserved keywords of value 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
......@@ -639,8 +639,21 @@ template_arg
: AT_SIGN arg
;
 
file
: HASH_SIGN ( INTEGER | IDENTIFIER )
| STRING
| FILE
;
type
: STRING
| TYPE
;
in_redirect_file
: ( LEFT_BRACKET arg RIGHT_BRACKET )? ( COLON_SIGN ( INTEGER | IDENTIFIER ) )? template_arg* ( arg | STRING )
: ( LEFT_BRACKET arg RIGHT_BRACKET )?
( COLON_SIGN ( INTEGER | IDENTIFIER ) )?
template_arg* file
;
 
in_redirect
......@@ -661,13 +674,13 @@ param
: common
| DASH_SIGN
| IDENTIFIER
| LEFT_PAREN arg RIGHT_PAREN CARET_SIGN? param
| LEFT_PAREN type RIGHT_PAREN CARET_SIGN? param
;
 
statement
: common ( );
| IDENTIFIER template_arg ( COLON_SIGN ( INTEGER | IDENTIFIER ) )? ( CARET_SIGN? param )*
| LEFT_PAREN arg RIGHT_PAREN CARET_SIGN? statement
| LEFT_PAREN type RIGHT_PAREN CARET_SIGN? statement
;
 
statement_list
......@@ -675,7 +688,7 @@ statement_list
;
 
out_redirect_file
: ( LEFT_BRACKET arg RIGHT_BRACKET )? ( arg | STRING )
: ( LEFT_BRACKET arg RIGHT_BRACKET )? file
;
 
out_redirect
......@@ -693,23 +706,27 @@ introspect_cast_from_to
;
 
introspect_command
: KW_ALGORITHMS arg? END
| KW_OVERLOADS arg template_arg* END
| KW_DATATYPES arg? END
| KW_CASTS introspect_cast_from_to arg? END
: KW_ALGORITHMS arg?
| KW_OVERLOADS arg template_arg*
| KW_DATATYPES arg?
| KW_CASTS introspect_cast_from_to arg?
| KW_VARIABLES ( DOLAR_SIGN arg )?
| KW_BINDINGS ( HASH_SIGN ( INTEGER | IDENTIFIER ) )?
;
 
command
: EXECUTE statement_list result
| QUIT statement_list?
| EXIT statement_list?
| HELP arg?
| INTROSPECT introspect_command
| SET ( INTEGER | IDENTIFIER ) ( INTEGER | IDENTIFIER | STRING )
| LOAD ( INTEGER | IDENTIFIER | STRING )
| UNLOAD ( INTEGER | IDENTIFIER | STRING )
;
parse
: EXECUTE statement_list result END
| QUIT statement_list? END
| EXIT statement_list? END
| HELP arg? END
| INTROSPECT introspect_command END
| SET ( INTEGER | IDENTIFIER ) ( INTEGER | IDENTIFIER | STRING ) END
| LOAD ( INTEGER | IDENTIFIER | STRING ) END
| UNLOAD ( INTEGER | IDENTIFIER | STRING ) END
: command ( SEMICOLON command ) END
;
\end{lstlisting}
 
......@@ -773,7 +790,8 @@ The file type specifications are ’xml’, ’string’, ’raw’, and ’file
The string and raw types require the content specification to be set with type argument introduced by a colon. The template parameter is extra information not used now.
 
\begin{lstlisting}
execute < [ raw ] :string::LinearString automaton.xml
execute "abc" | cli::builtin::WriteFile "file.txt" -
execute < [ raw ] :string::LinearString file.txt
\end{lstlisting}
 
The use of the in\_redirect symbol is overloaded and allows the creation of subquery.
......@@ -785,26 +803,26 @@ execute Determinize <( string::Parse @Automaton "NFA a b
<2 - -")
\end{lstlisting}
 
The in\_redirect\_file is also overloaded to set up a variable. That can later be used as a parameter of an algorithm.
Out\_redirect knows the type of the value printed, hence only the file type specification is required. The syntax is again an identifier in brackets. Based on the specified file type the argument of out\_redirect can be limited to certain types only.
 
\begin{lstlisting}
execute Determinize <( string::Parse @Automaton "NFA a b
>0 0 1
1 - 2
<2 - -" ) > \$dfa
execute Minimize \$dfa
<2 - -" ) > [ string ] dfa.txt
\end{lstlisting}
 
Out\_redirect\_file knows the type of the value printed, hence only the file type specification is required. The syntax is again an identifier in brackets. Based on the specified file type the argument to out\_redirect\_file can be limited to certain types only.
The out\_redirect is also overloaded to set up a variable. That can later be used as a parameter of an algorithm.
 
\begin{lstlisting}
execute Determinize <( string::Parse @Automaton "NFA a b
>0 0 1
1 - 2
<2 - -" ) > [ string ] dfa.txt
<2 - -" ) > \$dfa
execute Minimize \$dfa
\end{lstlisting}
 
Specifying no target file in the output redirection makes the result to be discarted.
Specifying no target file in the output redirection discarts the result.
 
\begin{lstlisting}
execute < automaton.xml >
......
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