File: README

package info (click to toggle)
asis 2005-5
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 6,424 kB
  • ctags: 27
  • sloc: ada: 73,883; makefile: 201
file content (97 lines) | stat: -rw-r--r-- 3,947 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
For doing this part of the ASIS tutorial, you should have the
executable of the asistant tool built, and this execitanle should be
on your path. asistant is built as a part of the standard ASIS
installation procedure. (If you do not have asistant built, refer to
the ASIS-for-GNAT Installation Guide - the top-level README file -
how to built it yourself).

It would be nice if you would have read the asistant users' guide
before doing the exercises in this part of the tutorial, but this is
not really necessary. You can easily guess the meaning of the
constructions of the asistant command language (more then a half of
this language are ASIS queries), and the asistant scripts making up
this tutorial contain enough comments to explain what happens. See
also the quick asistant guide in the end of this readme file.

You should do the following preparation to run these exercises:
- copy the whole content of this directory in your woprking
  directory;
  - create the tree files for the Ada source files. The Ada sources
  included into this tutorial made up a simple Ada program having the
  procedure Ex_Proc as its main subprogram, so you can create the
  tree files by the following command:

  >gnatmake -c -gnatc -gnatt ex_proc.adb

Now call asistant with the name of a script file as a parameter. A
script file is a text file containg the sequence of the asistant
commands.

  This tutorial contains two scripts:

  black_box.scr - contains tasks for performing some black-box
                  processing of ASIS Compilation Units;

  white_box.scr - contains tasks for performing some Element-level
                  (white-box) processing of ASIS Compilation Units;

Both scripts first demonstrate the effect of some ASIS queries and
then formulate the task to solve. The scripts contain both the hints
to find the solution and the version of the correct solution.

So, to start doing this part of exercises, you should type in the
command prompt:

> asistant black_box.scr

or

> asistant white_box.scr

and follow the information the script processing will output into the
command line window. The general scheme of all the exercises is: when
a script file is executed, it first performs some sequence of ASIS
queries, then it outputs the text of a task for you to do and
switches asistant into interactive mode. When resumed, it outputs the
solution for the task.

                     Quick asistant guide
                     ====================

asistant is an interactive ASIS interpreter which allows to "execute"
ASIS queries without writing the full ASIS application. asistant may
also interprete a sequence of commands written in a file (called a
script file), the input from the command line and from a script file
may be combined.

asistant allows to define and initialize dynamic variables of basic
ASIS types (Context, Compilation_Unit, Element) and some conventional
types (integer, string, boolean). The asistant command 'set'

    > set (var, <some_expression>)

defines an asistant variable 'var' and sets its type and initial
value from the type and initial value of '<some_expression>'. The
'set' command with a single parameter is used to define variables of
the ASIS Context type.

The asistant command 'print' outputs values of asistant variables and
expressions.

The asistant command 'pause', when used in a script file, paused the
interpretation of the command from the script file. When the script
is paused, asistant is switched into the interactive mode and a user
can input commands from the command prompt.

To resume the script, input the "run" command.

To quit asistant, type the 'quit' command.

If you make any error when working in the asistant environment,
asistant does not change any variable, it just generates an error
message and allows you to try again.

asistant keeps its input in the file input.log, and it keeps the
track of the session in the file session.log.

Go ahead and enjoy!