1
For doing this part of the ASIS tutorial, you should have the
2
executable of the asistant tool built, and this execitanle should be
3
on your path. asistant is built as a part of the standard ASIS
4
installation procedure. (If you do not have asistant built, refer to
5
the ASIS-for-GNAT Installation Guide - the top-level README file -
6
how to built it yourself).
8
It would be nice if you would have read the asistant users' guide
9
before doing the exercises in this part of the tutorial, but this is
10
not really necessary. You can easily guess the meaning of the
11
constructions of the asistant command language (more then a half of
12
this language are ASIS queries), and the asistant scripts making up
13
this tutorial contain enough comments to explain what happens. See
14
also the quick asistant guide in the end of this readme file.
16
You should do the following preparation to run these exercises:
17
- copy the whole content of this directory in your woprking
19
- create the tree files for the Ada source files. The Ada sources
20
included into this tutorial made up a simple Ada program having the
21
procedure Ex_Proc as its main subprogram, so you can create the
22
tree files by the following command:
24
>gnatmake -c -gnatc -gnatt ex_proc.adb
26
Now call asistant with the name of a script file as a parameter. A
27
script file is a text file containg the sequence of the asistant
30
This tutorial contains two scripts:
32
black_box.scr - contains tasks for performing some black-box
33
processing of ASIS Compilation Units;
35
white_box.scr - contains tasks for performing some Element-level
36
(white-box) processing of ASIS Compilation Units;
38
Both scripts first demonstrate the effect of some ASIS queries and
39
then formulate the task to solve. The scripts contain both the hints
40
to find the solution and the version of the correct solution.
42
So, to start doing this part of exercises, you should type in the
45
> asistant black_box.scr
49
> asistant white_box.scr
51
and follow the information the script processing will output into the
52
command line window. The general scheme of all the exercises is: when
53
a script file is executed, it first performs some sequence of ASIS
54
queries, then it outputs the text of a task for you to do and
55
switches asistant into interactive mode. When resumed, it outputs the
56
solution for the task.
61
asistant is an interactive ASIS interpreter which allows to "execute"
62
ASIS queries without writing the full ASIS application. asistant may
63
also interprete a sequence of commands written in a file (called a
64
script file), the input from the command line and from a script file
67
asistant allows to define and initialize dynamic variables of basic
68
ASIS types (Context, Compilation_Unit, Element) and some conventional
69
types (integer, string, boolean). The asistant command 'set'
71
> set (var, <some_expression>)
73
defines an asistant variable 'var' and sets its type and initial
74
value from the type and initial value of '<some_expression>'. The
75
'set' command with a single parameter is used to define variables of
76
the ASIS Context type.
78
The asistant command 'print' outputs values of asistant variables and
81
The asistant command 'pause', when used in a script file, paused the
82
interpretation of the command from the script file. When the script
83
is paused, asistant is switched into the interactive mode and a user
84
can input commands from the command prompt.
86
To resume the script, input the "run" command.
88
To quit asistant, type the 'quit' command.
90
If you make any error when working in the asistant environment,
91
asistant does not change any variable, it just generates an error
92
message and allows you to try again.
94
asistant keeps its input in the file input.log, and it keeps the
95
track of the session in the file session.log.
b'\\ No newline at end of file'